IM 6.7.8.8 Q16 Q16
-mask works fine for actual pixel processing of an image (such as -modulate). But I cannot seem to use it to get statistics.
Image: (pure red, pure green1, pure blue)
Mask:
I am expecting mean values of: 0,1,0
convert rgb.gif -mask rgb_mask.gif -format "%[fx:mean.r],%[fx:mean.g],%[fx:mean.b]" info:
0.333333,0.333333,0.333333
Which is the same as using no mask and getting the full image mean values!
convert rgb.gif -format "%[fx:mean.r],%[fx:mean.g],%[fx:mean.b]" info:
0.333333,0.333333,0.333333
Am I doing something wrong or is there some bug here?
P.S. Same issue with -clip-mask
possible bug -mask IM 6.7.8.8 Q16
Re: possible bug -mask IM 6.7.8.8 Q16
Read masks are not supported in ImageMagick 6 series. They might be supported in ImageMagick 7.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug -mask IM 6.7.8.8 Q16
According to Anthony's page at http://www.imagemagick.org/Usage/masking/#write_mask, this is a write mask.magick wrote:Read masks are not supported in ImageMagick 6 series. They might be supported in ImageMagick 7.
Are you saying that since it is not really processing pixels, only accessing them to get the image data, that it is then behaving as a read mask?
Re: possible bug -mask IM 6.7.8.8 Q16
Read mask / write mask, its still not supported-- at least not this moment. We're looking at supporting masks for image statistics over the next few days.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug -mask IM 6.7.8.8 Q16
magick wrote:Read mask / write mask, its still not supported-- at least not this moment. We're looking at supporting masks for image statistics over the next few days.
OK. Do it at your own pace. I have a work around that is slower, but still works. Thanks.
Re: possible bug -mask IM 6.7.8.8 Q16
With the pending patch in ImageMagick 7.0.0, we get:
- convert rgb.gif -mask rgb_mask.gif -format "%[fx:mean.r],%[fx:mean.g],%[fx:mean.b]" info:
0,1,0
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug -mask IM 6.7.8.8 Q16
magick wrote:With the pending patch in ImageMagick 7.0.0, we get:
- convert rgb.gif -mask rgb_mask.gif -format "%[fx:mean.r],%[fx:mean.g],%[fx:mean.b]" info:
0,1,0
Great! Sorry, I did not mean to be argumentative. I was just trying to understand as that was the first time I had tried using -mask. I think I understand the difference now between read and write masks.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: possible bug -mask IM 6.7.8.8 Q16
Be sure to understand that when read masks do get implemented. It is up to the individual operations to do the right thing when reading pixels. That is it may not be available on all operations..
Write mask just prevents writing. IMv7 will allow operators to skip processing of pixels that will not be written, but regardless the low level pixel routines in both Imv6 and Imv7, will stop those pixels being changed (or only partially changed during each operation for gray-level masks).
See masking
http://www.imagemagick.org/Usage/masking/#special_masks
The commond line interface to masking will likely change in IMv7 to allow better handling when read masks are added.
Specifically so you can set the 'last' image in the image list, to mask all the other images (and mask image removed from current list once set)
Write mask just prevents writing. IMv7 will allow operators to skip processing of pixels that will not be written, but regardless the low level pixel routines in both Imv6 and Imv7, will stop those pixels being changed (or only partially changed during each operation for gray-level masks).
See masking
http://www.imagemagick.org/Usage/masking/#special_masks
The commond line interface to masking will likely change in IMv7 to allow better handling when read masks are added.
Specifically so you can set the 'last' image in the image list, to mask all the other images (and mask image removed from current list once set)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/