This is a fairly simple ray tracer in c++. It is written completely from scratch and includes the implementation of .bmp file format, but you can remake it to work with formats you like. The .bmp format is used because of its simplicity.
The ray tracer itself has the implementation of only spheres, basic lightning and shading.
For better understanding of how it works, check out the tutorial: https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-ray-tracing/how-does-it-work