Setting C = 0.5 results in B = 0.25, when it should be 0.0 as the Catrom filter.
So:
convert rings_lg_orig.png -filter Cubic -set option:filter:c 0.5 -resize 600x rings_lg_orig_im_cubic_c05.png
gives the same result as:
convert rings_lg_orig.png -filter Cubic -set option:filter:b 0.25 -set option:filter:c 0.5 -resize 600x rings_lg_orig_im_cubic_b025_c05.png
As reported by compare.exe.
Regards.
Auto Filter Expert setting do not match Keys Filter
Auto Filter Expert setting do not match Keys Filter
Last edited by Carlos82 on 2009-06-22T02:47:38-07:00, edited 1 time in total.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Auto Filter Expert setting do not match Keys Filter
Could your IM be older than version 6.3.7-1 whcih was when I did ten re-programming o fthe filters with the addition of the Expert Controls.
If it is older than the settings would not work and all you would get is the default cubic filter which uses the values B=0 C=1
As such on an IM that is too old you would get the same result.
I checked the source code, and added a debugging print to the handling of B and C
-set option:filter:b 0.0 -set option:filter:c 0.746
sets B=0.000000 C=0.746000
-set option:filter:b 0.25 -set option:filter:c 0.5
sets B=0.250000 C=0.500000
A flicker comparison using
http://www.imagemagick.org/Usage/scripts/flicker_cmp
of the two images rings_lg_orig_im_cubic_c05.png and rings_lg_orig_im_cubic_b025_c05.png
shows a definite difference in results with a less blurred (more aliased) result for the first image (b=0).
A peak difference of about 10% so I would definably not say they were the same.
If it is older than the settings would not work and all you would get is the default cubic filter which uses the values B=0 C=1
As such on an IM that is too old you would get the same result.
I checked the source code, and added a debugging print to the handling of B and C
-set option:filter:b 0.0 -set option:filter:c 0.746
sets B=0.000000 C=0.746000
-set option:filter:b 0.25 -set option:filter:c 0.5
sets B=0.250000 C=0.500000
A flicker comparison using
http://www.imagemagick.org/Usage/scripts/flicker_cmp
of the two images rings_lg_orig_im_cubic_c05.png and rings_lg_orig_im_cubic_b025_c05.png
shows a definite difference in results with a less blurred (more aliased) result for the first image (b=0).
Code: Select all
compare -metric PAE rings_lg_orig_im_cubic_b025_c05.png \
rings_lg_orig_im_cubic_c05.png null:
6425 (0.0980392)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Auto Filter Expert setting do not match Keys Filter
Sorry the first command was wrong, I have edited the first post to fix it.
The version is 6.5.3-0 as reported by convert -version.
The version is 6.5.3-0 as reported by convert -version.
Re: Auto Filter Expert setting do not match Keys Filter
Do you get the same result now?
Regards.
Regards.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Auto Filter Expert setting do not match Keys Filter
Hmm yes they appear the same now... Checking with a debug statement...
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Auto Filter Expert setting do not match Keys Filter
Hmmm...
when C=0.5 but B is undefined , so IM set B to 0.25
that is definitely not correct... For a Keys filter B should be set to 0 to
create a Catmull-Rom Filter (equivelent to -filter catrom)
The opposite also does not seem to be right.. B=0.25 causes C to be 0.5
I think my formula is wrong...
Hmm going back to basics, a Keys filter is when... 2*C + B = 1
So B = 1-2*C or C = (1-B)/2
yes that checks out
Hmmm In my code I have
C=1.0-2.0*B and B=(1.0-C)/2.0
Damn I had the right formulas but with B and C swapped!! Fixing.
thank you for the pickup. This has been fixed, and will be release in IM v6.5.4-1
I will also note that automatic selection of the keys filter was broken in IM examples up until that version.
Thank you for the bug report.
Code: Select all
convert rings_lg_orig.png -filter Cubic -set option:filter:c 0.5 -resize 600x rings_lg_orig_im_cubic_c05.png
that is definitely not correct... For a Keys filter B should be set to 0 to
create a Catmull-Rom Filter (equivelent to -filter catrom)
The opposite also does not seem to be right.. B=0.25 causes C to be 0.5
I think my formula is wrong...
Hmm going back to basics, a Keys filter is when... 2*C + B = 1
So B = 1-2*C or C = (1-B)/2
yes that checks out
Hmmm In my code I have
C=1.0-2.0*B and B=(1.0-C)/2.0
Damn I had the right formulas but with B and C swapped!! Fixing.
thank you for the pickup. This has been fixed, and will be release in IM v6.5.4-1
I will also note that automatic selection of the keys filter was broken in IM examples up until that version.
Thank you for the bug report.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/