GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   ImageMagick thumbnails (https://gfy.com/showthread.php?t=561045)

jerzeemedia 01-07-2006 12:44 PM

ImageMagick thumbnails
 
Has anyone successfully used "convert" to thumbnail a large jpg while maintaining the aspect ratio so that the output isn't blurry/shitty?

psili 01-07-2006 12:55 PM

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:

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);

I'm sure there's always a better way, but the above is just an example.

Tom_PM 01-07-2006 01:12 PM

Does it have a "sharpen" filter? Try sharpening it mildly maybe.

Broda 01-07-2006 01:26 PM

Quote:

Originally Posted by PR_Tom
Does it have a "sharpen" filter? Try sharpening it mildly maybe.

...and despeckle. Optionally blur it too to make that crisp and glamourlike look some seem to prefer.
Best to play with it a bit :)

fris 01-07-2006 01:29 PM

manual crop all your thumbs for mgp/tgp ;)


All times are GMT -7. The time now is 02:17 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123