Just so I know how to handle things such as %[min], %[max], %[mean], %[standard-deviation] in my scripts, I don't see them any longer on http://www.imagemagick.org/script/escape.php as of 6.4.0-11, but now see image.minima, image.maxima, image.mean, image.standard_deviation on http://www.imagemagick.org/script/fx.php
Does that mean that the former are no longer available in 6.4.0-11?
If true, then I will put an IM version trap in my scripts to replace the older style with the newer style for releases >= 6.4.0-11. (I don't mean to look a gift-horse in the mouth, but when I raised the question of combining computations I did not expect that the older style would be removed completely. However, from a point of redundancy, I can understand if that is what you have done.)
Also in the former, you had %[standard-deviation] with a hyphen and now you have image.standard_deviation with an underscore. Is this correct or is there a typo?
I have not yet updated to 6.4.0-11 and am still on 6.4.0-10 and would like to understand the situation before upgrading, so I can plan on changes to my scripts.
I am also curious as to why you needed to use the "image." prefix to these variables. (Other things like intensity, hue, saturation, etc, which are also image dependent do not seem to start with "image.". I can understand why you could not use min an max, but minima and maxima do not conflict with the min and max operators)? This is not terribly important. Whatever you decided is fine and I can work with it. I am just curious about the rationale?
Thanks.
string formats to fx constants
Re: string formats to fx constants
%[min], %[max], %[mean], %[standard-deviation] are deprecated but still supported.
image.standard_deviation is the correct usage. Fx has a simple parser. It would interpret '-' as a subtract operation.
image.standard_deviation is the correct usage. Fx has a simple parser. It would interpret '-' as a subtract operation.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: string formats to fx constants
Thanks for the explanation. Being deprecated but supported makes it less urgent for me to rework all my scripts.
Still curious about why the need for the "image." prefix? If you have time to respond. If not, then not terribly important.
Thanks for all your work on this.
Still curious about why the need for the "image." prefix? If you have time to respond. If not, then not terribly important.
Thanks for all your work on this.
Re: string formats to fx constants
ImageMagick uses namespaces wherever possible. The image namespace is for attributes that apply to the entire image rather than an individual pixel. It also permits us to add additional attributes in the future. So far we have:
- image.resolution.x = x resolution
image.resolution.y = y resolution
image.depth = image depth
image.minima = image minima
image.maxima = image maxima
image.mean = image mean
image.standard_deviation = image standard deviation
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: string formats to fx constants
I just upgraded to IM 6.4.0-11 and wanted to confirm to you that the new image.minima, etc work fine.
convert rose: -format "%[min]" info:
5654
convert rose: -format "%[max]" info:
65535
convert rose: -format "%[mean]" info:
27022.8
convert rose: -format "%[standard-deviation]" info:
16982.2
convert rose: -format "%[fx:Quantumrange*image.minima]" info:
5654
convert rose: -format "%[fx:Quantumrange*image.maxima]" info:
65535
convert rose: -format "%[fx:Quantumrange*image.mean]" info:
27022.8
convert rose: -format "%[fx:Quantumrange*image.standard_deviation]" info:
16982.2
convert rose: -format "%[min]" info:
5654
convert rose: -format "%[max]" info:
65535
convert rose: -format "%[mean]" info:
27022.8
convert rose: -format "%[standard-deviation]" info:
16982.2
convert rose: -format "%[fx:Quantumrange*image.minima]" info:
5654
convert rose: -format "%[fx:Quantumrange*image.maxima]" info:
65535
convert rose: -format "%[fx:Quantumrange*image.mean]" info:
27022.8
convert rose: -format "%[fx:Quantumrange*image.standard_deviation]" info:
16982.2