Page 1 of 1

Resizing options

Posted: 2008-10-30T12:19:32-07:00
by sim123
What is the best option for image scaling (resizing) when I want good quality and good performance both at the same time?

Thanks for help and support.

Re: Resizing options

Posted: 2008-10-30T13:14:59-07:00
by magick
The -resize option without any filter or blur settings is the best compromise of speed and performance. To speed up resizing and while giving up just a little quality, use -scale. For pure speed use -sample or if you are generating small thumbnails, use -thumbnail.

Re: Resizing options

Posted: 2008-10-30T14:14:53-07:00
by sim123
Thanks for quick response, I am reading about resize option and it seems to working ok (I tried 2.5 mb image and its finished in 186 milisecond), I will try bigger images and post the results.

I have similar question here, I want to resize and image such that x and y dimensions are never greater than 200 pixels, so if I have 1057*2044 I want it to be resized to 200*200, I tried resize with ">" but it does not guarantee about both the dimensions, result image was 178*200 pixels.

Also if my image is like 1057*150, I want to scale it such that the new size will be 200*178 or if it is 130*1200 then it should be 130*200, how can I do that with IM? is it possible or do I need to right this logic by my own?

Thanks for all the help and support

Re: Resizing options

Posted: 2008-10-30T14:50:40-07:00
by Bonzo
Have you read the resize options here ? http://redux.imagemagick.org/script/com ... php#resize
I have similar question here, I want to resize and image such that x and y dimensions are never greater than 200 pixels, so if I have 1057*2044 I want it to be resized to 200*200, I tried resize with ">" but it does not guarantee about both the dimensions, result image was 178*200 pixels.

Also if my image is like 1057*150, I want to scale it such that the new size will be 200*178 or if it is 130*1200 then it should be 130*200, how can I do that with IM? is it possible or do I need to right this logic by my own?
To get the image to 200x200 try:

Code: Select all

-resize 200x200!
To get the 1057*150 image to 200*178 try:

Code: Select all

-resize 200x178!

Re: Resizing options

Posted: 2008-10-30T15:33:07-07:00
by sim123
Thanks for the reply, I read about resize options and tried exact option, it seems to be working now.

Can anyone please tell me what interpolation method IM use by default to do resizing (reducing the size mainly).

Thanks for all the help and support.

Re: Resizing options

Posted: 2008-10-30T17:07:50-07:00
by fmw42
sim123 wrote:Thanks for the reply, I read about resize options and tried exact option, it seems to be working now.

Can anyone please tell me what interpolation method IM use by default to do resizing (reducing the size mainly).

Thanks for all the help and support.

See: http://www.imagemagick.org/script/comma ... php#filter

"If you do not select a filter with this option, the filter defaults to Mitchell for a colormapped image, a image with a matte channel, or if the image is enlarged. Otherwise the filter default to Lanczos."

Re: Resizing options

Posted: 2008-10-31T01:01:13-07:00
by Bonzo
If you can run your code through php I have written a piece of code that will resize an image with all available filters. You can see which one you prefer then.

http://www.rubblewebs.co.uk./imagemagic ... filter.php