Page 1 of 1

possible bug -median IM 6.6.9.3

Posted: 2011-04-01T13:53:25-07:00
by fmw42
IM 6.6.9.3 Q16 Mac OSX Tiger

One of my scripts, isonoise, is not working as it used to. I get no change from the input image. The problem seems to stem from -median radius. It seems that radius=1 no longer makes any change to my image. I have to up the radius to 2 to get any effect. Has the definition or use of radius been changed at some point in -median? A radius=1 should mean a window of 3x3, if I understand its use correctly. Might this have to do with using same code for both -statistic median and for -median and how the window size is computed differently for each (size=2radius+1 for -median and size=size specified for -statistic)?

The script was last revised but working fine on 10/25/2007, so unfortunately many releases have gone by and I had not tested the script for quite a while.

input:
Image

convert gray_noise98.png -median 1 gray_noise98_med1.png
compare -metric rmse gray_noise98.png gray_noise98_med1.png null:
0 (0)

Re: possible bug -median IM 6.6.9.3

Posted: 2011-04-01T17:05:13-07:00
by magick
The median option supports geometry of width x height. We can support a radius with one number (e.g. -median 1) and width x height (e.g. -median 5x3) if you prefer. Note, -median 0 behaves as it did previously. It finds the optimal kernel width for the quantum depth of ImageMagick (typically 5x5).

Re: possible bug -median IM 6.6.9.3

Posted: 2011-04-01T17:18:26-07:00
by fmw42
magick wrote:The median option supports geometry of width x height. We can support a radius with one number (e.g. -median 1) and width x height (e.g. -median 5x3) if you prefer.

The issue is that -median 1 used to mean a 3x3 window. But now it means a 1x1 window. So the argument value has a different effect.

You must have changed it from -median radius to conform with -statistic median. I will change my scripts to accommodate the new more flexible argument, unless others feel that broken backward compatibility is bad. Please speak up or it will be left as is now.


If we go with the current format -median widthxheight, what release do I use for my script to make the switch. I assume it is 6.6.8-6 from the changelog.

I assume if one only uses only one value it used for both width and height. Is that correct?

Note the option page docs still say

-median radius

So I will edit that as well if appropriate.

Re: possible bug -median IM 6.6.9.3

Posted: 2011-04-02T01:29:45-07:00
by anthony
Perhaps it is time to add warnings about 'depreciated' options.

I mean -pen is still around even though it has not been used since IM v5 or was that IM v4!