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.
A PPM file is a raster image saved in the Portable Pixmap format. It contains plain text that specifies the image's type (plain or "raw"), its number of columns and rows, and its maximum color value.
With Adobe Photoshop, you can open a PPM file and then convert it to another format.
PPM is a simple format for storing images portable pixmap: color (PPM), grayscale (PGM) and black and white (PBM). These formats can provide an intermediate representation of the data when converting raster image files listed three types between different platforms. PPM format was developed by Jeff Poskanzerom.
Quick and dirty: download Imagemagick and use it from CLI:
convert xx.ppm xx.png
or use Imagemagick's dll API
Whilst ImageMagick will happily do what you need, it is actually a sledgehammer to crack a nut, and considerably more cumbersome and space and time-consuming to install than the NetPBM suite.
With that, you would do:
pnmtopng image.ppm > result.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With