ImageMagick thumbnails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jerzeemedia
    Confirmed User
    • May 2004
    • 1532

    #1

    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?
    Free Adult Blog Hosting
    http://www.waqn.com

    free porn
    www.mojohost.com - Best guys, best host.
  • psili
    Confirmed User
    • Apr 2003
    • 5526

    #2
    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.
    Your post count means nothing.

    Comment

    • Tom_PM
      Porn Meister
      • Feb 2005
      • 16443

      #3
      Does it have a "sharpen" filter? Try sharpening it mildly maybe.
      43-922-863 Shut up and play your guitar.

      Comment

      • Broda
        Confirmed User
        • Feb 2003
        • 1874

        #4
        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
        CheapAssDesigns.com - when you need quality designs at affordable prices.
        icq: 230-729-205
        info |at| cheap ass designs dot com

        Comment

        • fris
          Too lazy to set a custom title
          • Aug 2002
          • 55703

          #5
          manual crop all your thumbs for mgp/tgp ;)
          Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

          Comment

          Working...