Wiki › Project

PPM to PNG converter

Article
From Chaipat's knowledge graph

PPM to PNG converter is a small C++ program that turns PPM images, the simplest uncompressed image format, into PNG files using libpng. He wrote it to view the output of his ray tracer, which writes PPM. It is included as a Git submodule in the ray-tracing projects and built with CMake.

What it reads

  • P1: monochrome bitmaps (PBM).
  • P3: RGB pixmaps written as plain text.
  • P6: RGB pixmaps in binary.

It takes two arguments, the PPM file and the PNG to write (ppm_to_png input.ppm output.png), and reports when the conversion succeeded.

See also