《Ray tracing in one weekend》is a good book for ray tracing tutorial, and Peter Shirley implements a simple ray tracing engine by C++.
This is my Ray Tracing Tutorial of JAVA version.
The output of my projects is a PPM(P3) file. You can use ImageMagick to transfer into a JPG file, or you can use other Image Viewer software(eg: XnView) to open it.
#ppm2jpg
import PythonMagick as PM
img = PM.Image(r"C:\Users\yh\Documents\CG\result\Chapter6_20_39_01.ppm")
img.write(r"C:\Users\yh\Documents\CG\result\Cp6.jpg")