Page 1 of 1
make outside of path with id transparent - correct usage
Posted: 2014-08-22T06:14:38-07:00
by zaratol
Hi, i know this is really old topic, but currently i'm confused.
In ancient time like 2011 we had to use:
convert [input] +clip-path [id] -draw "color 0,0 reset" [output].
This changed sometime and we had Topic
viewtopic.php?f=3&t=22081&p=91608&hilit ... ate#p91608
and Documentation
http://imagemagick.org/script/command-l ... s.php#clip was changed accordingly.
So new commandline would look like:
convert [input] -clip-path [id] -negate -draw "color 0,0 reset" [output]
But in current release:
Code: Select all
convert --version
Version: ImageMagick 6.8.9-7 Q16 x64 2014-08-16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo freetype jbig jng jp2 jpeg lcms lqr pangocairo png ps rsvg tiff webp xml zlib
i have to use +clip-path [id] again to get outside of path, did i miss a change?
Re: make outside of path with id transparent - correct usage
Posted: 2014-08-22T06:26:35-07:00
by zaratol
Current Result:
- * -clip -negate - inside of clipping path is transparent
* -clip - inside of clipping path is transparent
* +clip -everything transparent
* -clip-path "#1" - inside of clipping path is transparent
* -clip-path "#1" -negate - inside of clipping path is transparent
* +clip-path "#1" -outside of clipping path is transparent
Re: make outside of path with id transparent - correct usage
Posted: 2014-08-22T06:49:45-07:00
by snibgo
I'm not sure what you are trying to do.
As I understand it (I could be wrong) the "+" versions turn off the clipping. Clipping is off by default, so they are pointless unless you have a preceding "-" version.
There isn't a simple method to activate a clipping mask but negate its effect. "-negate" will negate the image, and has no effect on the clipping mask.
Re: make outside of path with id transparent - correct usage
Posted: 2014-08-22T07:46:34-07:00
by zaratol
Ok sorry i will give some examples
source Image:
http://home.arcor.de/durius.obsidian/testcases/rgb.tif
convert -version
Version: ImageMagick 6.8.9-7
convert rgb.tif +clip-path "#1" -tile pattern:checkerboard -draw "color 0,0 reset" 6897_plus.jpg
convert rgb.tif -clip-path "#1" -negate -tile pattern:checkerboard -draw "color 0,0 reset" 6897_negate.jpg
I would have expected that with current version i would have to negate clipping path if i want to select outside of clipping path and that with +clip-path i would get full transparent image.
6897_plus.jpg shows the result i want, but i would have expected that i need different commandline
Re: make outside of path with id transparent - correct usage
Posted: 2014-08-22T08:08:25-07:00
by snibgo
You have two variables: "+" or "-", and "-negate" or no "-negate".
Testing these four variations with your file, IM v 6.8.9-5, "-negate" or not makes no difference. "+" or "-" makes the difference you show.
Which has blown my understanding and the documentation of what "+clip-path" does. (Being able to negate the clip path is useful, but I didn't think "+" would do it.)
Some with more knowledge than me would need to comment.
Re: make outside of path with id transparent - correct usage
Posted: 2014-08-22T08:26:50-07:00
by zaratol
snibgo wrote:
Which has blown my understanding and the documentation of what "+clip-path" does. (Being able to negate the clip path is useful, but I didn't think "+" would do it.)
mine too, because i'm pretty sure that once upon a time +clip behaved similiar as +clip-path now, thats why
viewtopic.php?f=3&t=22081&p=91608&hilit ... ate#p91608
was posted as a bug. After reading that topic i got the impression i need to change my old scripts, because i use +clip-path in this way since like 2011 but did not update ImageMagick where this method is used.
I just now want to make sure i use the "correct" way to select outside of a clipping Path.