convert rect.jpg -threshold 99.8% -fill "rgb(75%,75%,75%)" -opaque white mask.jpg

Note: you should also be able to use gray75 or grey75 instead of rgb(...)
See: http://imagemagick.org/script/color.php

These two alternatives give deviant results: in the first case, the gray background is somewhat transparent, while it is completely opaque when I make use of gray75.

> convert backgroundimage overlayimage maskimage -composite resultimage

Yes, this works in principle, but the functioning of "mask" is inversively to what I would have expected: black is transparent and white is opaque! Thus I arrive at the correct mask by

convert rect.jpg -threshold 99.8% -negate -fill gray50 mask.jpg

The opaque option seems not to be needed.
......

I though have to admit that I don't quite understand how the fill option exactly functions over here (?).

Thanks for your help on this.
Wolfgang Hugemann


_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to