Tutorial 6 Converting Images from .jpg to .png or from .png to .jpg

Tutorial on how to convert images using OpenCV on 64bit Linux Ubuntu 13.04

OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library can take advantage of multi-core processing. Adopted all around the world, OpenCV has more than 47 thousand people in their user community and estimated number of downloads exceeding 6 million. Usage ranges from interactive art, to mines inspection, stitching maps on the web or through advanced robotics.

helpful links:
http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html
http://linuxconfig.org/introduction-to-computer-vision-with-opencv-on-linux
http://opencv.org/books.html

Source Code:
Installing imagemagick

$  identify -version


Download ImageMagick.tar.gz from www.imagemagick.org
$ tar xvfz ImageMagick.tar.gz
$ cd ImageMagick-x.x.x
$ ./configure
$ make
$ sudo make install
$ sudo ldconfig /usr/local/lib
$ /usr/local/bin/convert logo: logo.gif
$ make check


to convert an image in the JPEG format to PNG
$ convert blue_rose.jpg blue_rose.png


to reduce the image size before it is written to the PNG format
$ convert blue_rose.jpg -resize 50% blue_rose.png

to create a version PNG version of all your JPG files
mogrify -format png *.jpg

to combine multiple image-processing operations to produce complex results
$ convert -size 320x85 canvas:none -font Bookman-DemiItalic -pointsize 72 \
-draw "text 25,60 'Magick'" -channel RGBA -blur 0x6 -fill darkred -stroke magenta \
-draw "text 20,55 'Magick'" fuzzy-magick.png

For more examples
http://www.imagemagick.org/Usag