Page 1 of 1

-Define - which image size?

Posted: 2010-01-18T06:04:16-07:00
by Albireo
Hello!

Which dimensions should be set to "define" to optimize conversion?
for example: I have an .jpg image 1600x1200 (maybe larger), and want a new image on the web.
(I don't know the optimal image size on web :) )

Example of a "convert" Commando:

Code: Select all

convert -define jpeg:size=240x180 Image.jpg -resize 100x80 NewImage.gif
Is it optimal to give "-define" double size as the size of the new image?
Will it be a lower picture quality, by using "-define"? (instead of only using "-resize")

__________________________________________________________________________

Info:

On page: http://www.imagemagick.org/Usage/formats/#jpg_read
are the following example: (I don't know the size of image.jpg)

Code: Select all

convert -define jpeg:size=240x180 image.jpg -thumbnail 120x90 thumbs/image.gif
On the site:
http://www.imagemagick.org/script/comma ... hp?#define
can you read about the benefits of using "-define"

On this site:
http://www.imagemagick.org/Usage/formats/#jpg_read
I found the following: "This setting is a hint to the JPEG image library to read just enough of the input (JPEG) image file to create an image that is at least the given size (width × height) or larger."

//Jan

Re: -Define - which image size?

Posted: 2010-01-18T06:37:27-07:00
by Bonzo
The jpg "hint" speeds up the conversion size of the jpg and should be the same as the finished image size so I would use:

Code: Select all

convert -size 100x80 Image.jpg -resize 100x80 NewImage.gif
For a 2.8Mb image it resized nearly 3x faster : http://www.rubblewebs.co.uk/imagemagick/notes/speed.php

Looking at one of your links I see that:
Before IM v6.5.6-0 this coder setting was extracted from the "-size" setting. This caused problems when users used "-size" for image creation but then had JPEG reading produce unexpected results. As such this was changed to be a special coder setting instead.

On older versions you may need to reset the setting using "+size before reading JPEG images.
The difference between -resize ( just resize and leave all EXIF data ) -thumbnail ( resize and remove all EXIF data except colour profile ) -resize or -thumbnail and -strip ( remove all EXIF data and colour profile ).
Removing the EXIF data can reduce the file size quite a bit.

Re: -Define - which image size?

Posted: 2010-01-18T08:00:33-07:00
by Albireo
Thank you!
Bonzo wrote:The jpg "hint" speeds up the conversion size of the jpg and should be the same as the finished image size so I would use:......
But, in all example, "-define" has the double size against the final image.
(double size - applies it only when doing "thumbnails"? or...)

/Jan