Results 1 to 4 of 4
  1. #1

    Imagemagick (how to reduce thumbnail size)

    Hello,

    I use Imagemagick to create thumbnails from jpg images. The problem is that I don't know how to reduce thumbnail size.

    For example, one of thumbnails (67x90 px) is 1 KB, but another thumbnail (90x68 px) - 53 KB !!!

    Is there any way how to keep all thumbnails under 3-5 KB?

    I use this command:

    PHP Code:
    exec("convert -geometry \"".$newwidth."x".$newheight."\" \"$sourcefile\" \"$destinationfile\""); 
    Thank you in advance.

  2. #2
    Join Date
    Mar 2003
    Posts
    663
    Hi, this is just straight from my head. You can consider using PHP function filesize() to check the thumbnail size and use imagemagick downsampling to reduce the number of pixels in the image. Of course, the quality of the image won't be as sharp. I guess for your case, you don't mind at all.
    Member Since 2003.

  3. #3
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Try "convert -strip -geometry etc. etc."
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  4. #4
    Thank you very much for your replies. It looks that "-strip" did the trick.
    I just uploaded an image and it's thumbnail size with "strip" is 1.28 KB. Without "strip" it was 58 kb.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •