Page 1 of 1

[RESOLVED]possible bug disabling mask from -clip IM 6.8.0.0

Posted: 2012-10-15T15:45:27-07:00
by fmw42
see
viewtopic.php?f=1&t=22069&p=91269#p91269

It would appear that the use of -strip +clip-mask +mask is not disabling the mask created by -clip. The +clip form supposedly just negates the mask.

According to http://www.imagemagick.org/Usage/masking/#clip

"Note that the "+clip" operator negates the mask, it does not turn off and remove the clip mask. To turn it off you need to use "+clip_mask" instead."



Is this a bug or is there some other command that disables the masking from -clip?

Re: possible bug disabling mask from -clip IM 6.8.0.0 Q16

Posted: 2012-10-15T19:16:45-07:00
by anthony
The mask for clip will only be enabled when you use -clip before +strip.

in IMv6 the -clip or -clip-mask (boolean) is a separate mask to the more normal write -mask (grayscale). In IMv7 they are the same (whcih makes sense)

Re: possible bug disabling mask from -clip IM 6.8.0.0 Q16

Posted: 2012-10-15T20:08:04-07:00
by fmw42
anthony wrote:The mask for clip will only be enabled when you use -clip before +strip.

in IMv6 the -clip or -clip-mask (boolean) is a separate mask to the more normal write -mask (grayscale). In IMv7 they are the same (whcih makes sense)

Sorry, I am not following the above.

How does that tell me how to use -clip, then disable it in the same command line so that the subsequent operations are global and not limited to the clip area.

How do I avoid having to use a pipe such as the following to convert the transparent background to white:

convert 1.psd -alpha transparent -clip -alpha opaque miff:- | convert - -background white -flatten 1test8.png


where the following does not work:

convert -respect-parenthesis \( 1.psd -alpha transparent -clip -alpha opaque -strip +clip-mask +mask \) \
-channel rgba -alpha on -background white -alpha background -compose over +geometry -flatten 1test2.png (or .jpg)

Re: possible bug disabling mask from -clip IM 6.8.0.0 Q16

Posted: 2012-10-15T23:09:55-07:00
by anthony
It should still unset the clip mask. that -clip set. If it isn't it is a bug.
I mentioned it because I discovered it from programming, and noted that you have to use the other to unset it
If it is not working, (and it should) then there is a bug about unsetting the clipmask from an image.

Hmmm...
quick test...

convert red_image.png -clip-mask write_mask.png -fill blue -opaque red \
+clip-mask -alpha transparent show:

Well the writable area was made blue, then transparent. but the unwritable area was not made transparent!
The result of the above should have been everything transparent, It wasn't.

Houston, we have a problem! this is a definite bug.

Re: possible bug disabling mask from -clip IM 6.8.0.0 Q16

Posted: 2012-10-16T10:27:21-07:00
by fmw42
anthony wrote: Houston, we have a problem! this is a definite bug.
Thanks for the confirmation.

Re: possible bug disabling mask from -clip IM 6.8.0.0 Q16

Posted: 2012-10-16T15:21:26-07:00
by fmw42
anthony wrote: Houston, we have a problem! this is a definite bug.

Here is a summary:

Using +strip +clip-mask +mask, I cannot disable the clip mask in the command line.

This works by piping the output to get rid of the clip mask:

convert 1.psd -alpha transparent -clip -alpha opaque miff:- | convert - -background white -flatten 1test10.png


This does not work:

convert 1.psd -alpha transparent -clip -alpha opaque -strip +clip-mask +mask -background white -flatten 1test2.png


Input is at:
http://www.dragoniadev.com/download/1.psd

Re: possible bug disabling mask from -clip IM 6.8.0.0 Q16

Posted: 2012-10-23T10:01:23-07:00
by fmw42
The use of +clip does indeed remove the mask contrary to the Usage page that said it negated it. So the following does work.


convert 1.psd -alpha transparent -clip -alpha opaque -strip +clip \
-background white -alpha background -flatten 1test2.png