Click here to Skip to main content
15,035,723 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I captured .ppm file from avi file. How can I convert .ppm into .jpg only using C for further processing? Please help me.
Updated 17-Nov-13 18:13pm
enhzflep 18-Nov-13 1:01am
Since there's so much work that goes into a JPEG encoder/decoder, its not a practical solution to write that part yourself (about 1 man-year of work if my memory serves me correctly).

From a quick glance, the PPM format looks pretty simple, though there (almost certainly) has to be a library for that too.

I'd look at getting the data from the PPM file into a binary format, before using libjpeg to save it as you wish. If using c++ (& windows), you would then have access to GDI+ which is a part of windows that will let you save an image in any one of a number of different formats.
nv3 18-Nov-13 7:43am
My virtual 5.

1 solution

read this legendary article: CxImage
it served me well in fetching some details in image processing.

if you have a hand on COM you can try:[^]

if you work from the scratch: draw the ppm on a DC in which your bitmap is selected. So you have the ppm in the bitmap after deselecting and go on.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900