A simple tool that works even with image files of big dimensions.
This is a simple image converter from .ppm to .jpeg, and can work with files of several Gigabytes. It also is a very small lib that allows you to easilly save a .ppm file in the P6 binary format. The lib also works for big files. This lib uses the stb include image files bindings that have to be compiled with the make on the Odin slash vendors slash stb slash src .
Usage : ppm2jpeg -q <quality> <input.ppm> <output.jpeg>
-q <quality> JPEG quality ( 1 - 100, default: 90 )
<input.ppm> Input PPM image file
<output.jpeg> Output JPEG image file
// Save .ppm image to file in P6 - binary mode ( not compressed )
save_ppm_to_file :: proc ( output_file_name : string,
buffer : [ ]u8, // 3 Channels R G B
width : int,
height : int ) ->
( ok : bool )MIT Open Source License
Best regards,
Joao Carvalho