Has anyone successfully used "convert" to thumbnail a large jpg while maintaining the aspect ratio so that the output isn't blurry/shitty?
ImageMagick thumbnails
Collapse
X
-
ImageMagick thumbnails
Tags: None -
I'm not sure what you mean by "blurry / shitty", but I've used ImageMagick for a number of projects and the thumbs seem to turn out file.
What I first did is figure out if the image is landscape or portrait, then resize the image. After I resize it, I then crop it to a thumbnail.
I apologize for the random PHP code below, but it's what I've been using for ImageMagick with PHP to batch images, for example:
I'm sure there's always a better way, but the above is just an example.Code://-- original image list($width,$height,$type,$attr) = getimagesize($curLgFile); //-- thumbnail sizes $mdW = '285'; // medium width $mdH = '244'; // medium height // figure out aspect if($width > $height) // landscape { $width = $width * ($mdH / $height); $height = $mdW; } else { $height = $height * ($mdW / $width); $width = $mdW; } // convert the LARGE image into smaller in the MEDIUM directory $bcmd = $imagemagick_path.'convert -resize '.ceil($width).'x'.ceil($height).' ' .$curLgFile.' '.$newMdFile; system($bcmd,$output); // then crop the medium to what we want $bcmd = $imagemagick_path.'convert -crop '.$mdW.'x'.$mdH.'+0+0 ' .$newMdFile.' '.$newMdFile; system($bcmd,$output);Your post count means nothing. -
...and despeckle. Optionally blur it too to make that crisp and glamourlike look some seem to prefer.Originally posted by PR_TomDoes it have a "sharpen" filter? Try sharpening it mildly maybe.
Best to play with it a bit
CheapAssDesigns.com - when you need quality designs at affordable prices.
icq: 230-729-205
info |at| cheap ass designs dot comComment




Comment