Wednesday, November 26, 2008

Improving Image Quality with Imagemagick in Linux

I have stuck with tuning the quality of image when converting from pdf2image using Imagemagick opensource software.

After a long research I found the solution.

I have used the "density" for tuning the quality of the image, but it will increase the image size, width and height.

While converting the image the default density will be set to 72, so we can increase as per our need to tune the quality of the image.

But if we increase the density, the performance will get slower. (Best the quality, slower the converting performance)

Command to do in linux: Convert -density 100

You can play around by changing the density value from 72 to 600.

Hope you have achived the quality of image you have required.

Monday, November 24, 2008

Open Source/Free Software to Convert Pdf 2 Image

I was searching for nearly 2 days to find this open source to convert the pdf to images.

It was Quite Interesting to do R & D and find the Solution.

The open source is "ImageMagicK"

Its available in windows and Linux.

I have used for Linux version.

Steps to Install in Linux.

Just you need to give yum install imagemagick, it will take bit of time, then once its installed
you need to download MagickWand (http://www.magickwand.org/download/php/).

After downloading the required zip, extract it and the go the location of MagicWand folder.

Its inside MagicWand (ie. [root@workgroup MagicWandForPhp-1.0.6]# ] the excute the command line ./configure

So it will get installed.

Then execute the command phpinze.

So now the opensoruce ImageMagick successfully installed in your server.

Now you can excute the command "display" to check.

To convert Pdf2image you can execute "Convert ["pdfname"] ["output image file name"]

If needed you can give the location of input file/out file.

For more info.
http://www.ioncannon.net/php/75/how-to-compile-imagemagick-for-php-by-hand/
http://ctsasikumar.blogspot.com/2008/07/image-magic-in-linux-convert-pdf-to-jpj.html