Convert image from jpg tp png

Hello every one
i want to convert image from jpg to png format !!!
any suggestions!!!

thanks
First decompress the jpg, then recompress the image using the png algorithm.
Look it up. This is a programming forum, and even if this is for some kind of program we don't have *all* the answers.
thanks jsmith


tummychow:
I think i am asking in the right place as i ask for a [b]programming guide[/b]
Well we don't have the libraries... have you checked online?
You can do what jsmith suggested using libjpeg and libpng. There are also some image manipulation libraries around (e.g. ImageMagick, FreeImage), which let you load and save with only a few function calls.
Boost GIL rocks for this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "boost/gil/gil_all.hpp"
#include "boost/gil/extension/io/jpeg_io.hpp"
#include "boost/gil/extension/io/png_io.hpp"

int main(int argc, char* argv[])
{
    if (argc < 3) return 1;

    using namespace boost::gil;
    rgb8_image_t im;

    jpeg_read_image(argv[1], im);
    png_write_view(argv[2], view(im));
    return 0;
}


make "LDFLAGS=-lpng -ljpeg" gil

That is pretty awesome.
There is also a utility on sourceforge called optipng which converts bmps to pngs.
Topic archived. No new replies allowed.