[magick-users] Equivalence of convert command for Magick++
Anthony Thyssen
anthony at griffith.edu.au
Wed Oct 29 17:22:06 PDT 2008
Elie Zedeck RANDRIAMIANDRIRAY on wrote...
| Hello guys,
|
| I'm trying to transcribe this convert command (from the Usage example):
|
| convert mask_light.png -negate -background white -channel A -combine
| +channel mask_lighting.png
|
| into the equivalent for Magick++.
|
These is a more modern version of the example sequence the above was
taken from. See Advanced, Better 3-D Logo Generation
http://www.imagemagick.org/Usage/advanced/#3d-logos-2
It is also a VERY VERY old method. With the latest IM you can instead
use...
convert mask_light.png -background white -alpha shape mask_lighting.png
Note that you do not need a 'negate' for the above, as the image is an
alpha channel greyscale mask, where combine uses a matte greyscale mask.
See IM Examples, Basics, Controlling Image Transparency, Shape
(converting a greyscale mask to a shaped mask)
http://www.imagemagick.org/Usage/basics/#alpha_shape
However the implementation is also equivelent to
convert mask_light.png mask_light.png \
+matte -compose CopyOpacity -composite \
-fill white -colorise 100% mask_lighting.png
or using more modern options...
convert mask_light.png mask_light.png \
-alpha off -compose CopyOpacity -composite \
+level-colors white mask_lighting.png
Those last few examples should be easy to convert to Magick++
ALL the above achieve the same result. This is convert a grayscale alpha
mask into a colored shape mask.
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
Symbolic Link(n) : ``A door closes quietly behind you, you are in a
twisty maze of little passages, all different.''
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list