filesize of an image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
webshaker
Posts: 16
Joined: 2007-07-25T15:42:25-07:00

filesize of an image

Post by webshaker »

Hi I try to resize a big jpeg image to make a thumb....

the original picture is this one
http://scrapblog.chez-les-filles.com/rp ... =54.a5e682

the thumb is there
http://scrapblog.chez-les-filles.com/rp ... =54.a5e682

the command I use is the next one
convert -quality 85 -delay 250 thumb.jpg -resize 128x128 original.jpg

the question is:
Why does my thumb filesize is 30ko !!!!
It seem to be a litlle big no ?

thank's
Etienne
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: filesize of an image

Post by Bonzo »

Your code is a little bit wrong -delay is to do with animations and you are supposed to read the original image in first:

Code: Select all

// Tidy code - Resulting Filesize: 10.8477kb
convert original.jpg -resize 128x128 -quality 85 thumb.jpg
// Remove EXIF data etc. with -strip - Resulting Filesize: 3.66992kb
convert original.jpg -strip -resize 128x128 -quality 85 thumb.jpg
// Thumbnail strips any EXIF data anyway -Resulting Filesize: 3.66992kb
convert original.jpg -thumbnail 128x128 -quality 85 thumb.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: filesize of an image

Post by anthony »

Your JPEG image has a profile which is preserved in the thumbnail generating a huge file. Use -thumbnail rather than -resize which will also -strip the profiles form the final image.

See IM Examples, Thumbnailing
http://imagemagick.org/Usage/thumbnails/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply