Fill preserving transparency

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

From my answer on the IM mailing list...

The equivelent operation in IM is -colorize which automatically preserves transparency...

Code: Select all

  convert  asterisk_black.png \
           -fill fuschia -colorize 100% \
           asterisk_fuschia.png
A value of 100% is a total replacement of all non-transparent color components. 50% will overlay a 50% transparent color over the existing color.

See.. IM Examples, Color Modifications, Uniformly Color Tinting Images
http://www.cit.gu.edu.au/~anthony/graph ... r/#tinting

If your original image is mostly grey, with some black and white highlights You can color the grey and keep the highlights using -tint

See IM Examples, Color Modifications, Color Tinting Greys
http://www.cit.gu.edu.au/~anthony/graph ... olor/#tint

For information on such grey highlight images.. see..
Image Transformations, Creating Overlay Highlighting
http://www.cit.gu.edu.au/~anthony/graph ... de_overlay

The is part however is much more 'expert' level. And is more about using -shade to generate 3-D shapes. The ideas presented are valid for all these types of images.

Enjoy...
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply