Conversion of Multipage TIF to JPG thumbnail very pixellated

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Re: Conversion of Multipage TIF to JPG thumbnail very pixellated

Post by mkoppanen »

Have you tried calling MagickSetResolution(300, 300); before reading in the TIFF image? Not sure if it helps..
Mikko Koppanen
My blog: http://valokuva.org
falakniazi
Posts: 2
Joined: 2011-08-05T10:30:44-07:00
Authentication code: 8675308

Re: Conversion of Multipage TIF to JPG thumbnail very pixell

Post by falakniazi »

Following code will help to convert multipage tif to jpg thumbnail. For further details can be found at http://sourcecodemania.com/converting-m ... if-in-php/

Code: Select all

<?php
try
{
// Saving every page of a TIFF separately as a JPG thumbnail
$images = new Imagick("testing.tif"); 
foreach($images as $i=>$image) {
    // Providing 0 forces thumbnail Image to maintain aspect ratio
    $image->thumbnailImage(768,0);
    $image->writeImage("page".$i.".jpg");
    echo "<img src='page$i.jpg' alt='images' ></img>";
}
$images->clear();
}
catch(Exception $e)
{
        echo $e->getMessage();
}
?>
Post Reply