Converting ppm to png

Viewed 33625

In Linux I am getting .PPM files as the image format, this needs to be converted to PNG and then saved. I was looking at some API's to achieve this conversion from PPM to PNG. Can this be done using GDI+, as this would become native?

If that is not possible then I think freeimage or pnglib can accomplish that, however I would prefer to use native gdi+ if possible.

5 Answers

you can use ffmpeg, for batch conversion you can do

#!/bin/bash
for i in *.ppm;
  do name=`echo "$i" | cut -d'.' -f1`
  echo "$name"
  ffmpeg -i "$i" "${name}.png"
done
Related