Page 1 of 1
Why are IM and GIMP different on downscaling (same filter)
Posted: 2008-05-08T22:09:45-07:00
by waveletboy
Both of IM and GIMP use Sinc filter.
Because the original is 3072x2304, and I want to resize it to 800x600, I downscale it two times.
For IM,
convert input.jpg -filter Sinc -resize 1600x1200 -filter Sinc -resize 800x600 -quality 100 output.jpg
For GIMP, I use "Scale Image" menu and select Sinc(Lanczos 3) Interpoation. Also scale two times as 1600x1200 and 800x600.
Also I tried Lanczos on IM, I can't tell the difference between Sinc and Lanczos.
It looks GIMP has more sharpen effect than IM. Could anyone tell me why? Thanks.
Re: Why are IM and GIMP different on downscaling (same filter)
Posted: 2008-05-08T22:19:11-07:00
by fmw42
There are a lot of factors that make a filter implementation on one system different from another system. Some of these factors are how many filter taps or support (how many samples are used in width and height), lobes and windowing.
For IM this is all detailed on the following page. Thanks to Anthony for all his hard work in improving IM's filter capabilities and his detailed explanations and examples.
http://www.imagemagick.org/Usage/resize/
There are now expert settings that will let you control these factors as well as special support for more blurring or sharpening.
GIMP is an unknown in terms of what they created in terms of all these parameters. You would have to download the source code for both and compare.
Re: Why are IM and GIMP different on downscaling (same filter)
Posted: 2008-05-09T07:16:41-07:00
by waveletboy
Thanks a lot. I have read Anthony's work before I raise the question. For a rookie like me, I cannot totally understand it.
Although GIMP has more sharpen looking on Sinc(Lanczos3) may be good for first looking, but it has too many spurious edges. I will still use IM because I don't know how to adjust the filters.
fmw42 wrote:There are a lot of factors that make a filter implementation on one system different from another system. Some of these factors are how many filter taps or support (how many samples are used in width and height), lobes and windowing.
For IM this is all detailed on the following page. Thanks to Anthony for all his hard work in improving IM's filter capabilities and his detailed explanations and examples.
http://www.imagemagick.org/Usage/resize/
There are now expert settings that will let you control these factors as well as special support for more blurring or sharpening.
GIMP is an unknown in terms of what they created in terms of all these parameters. You would have to download the source code for both and compare.
Re: Why are IM and GIMP different on downscaling (same filter)
Posted: 2008-05-26T22:18:24-07:00
by anthony
the 'Sinc' filter in IM is present as a raw function for use in expert selections of the filter and windowing function. It really shouldn't be selected directly as an actual filter function.
By default selecting -filter Sinc, will result in a Blackman windowed Sinc filter (equivelent to -filter Blackman), and is done that way purely for historical reasons. (Previous versions of IM did this).
The Lanczos filter will result in a 3 Lobed Sinc windowed Sinc filter, which is equivalent to the one in Gimp and often thought of as the best compromise of all the Sinc family of windowed filters.
The default filters in IM is 'Lanczos' for shrinking images without any transparency, and the 'Mitchell' cubic filter for all other cases (as it has a reduced ringing artifact, and is faster due to a smaller 'support' window, while still being a very good filter).