[prev in list] [next in list] [prev in thread] [next in thread] 

List:       imagemagick-user
Subject:    Re: [magick-users] Colorizing an image
From:       Anthony Thyssen <anthony () griffith ! edu ! au>
Date:       2006-05-31 6:19:06
Message-ID: 200605310619.k4V6J6fr011982 () wumpus ! itc ! gu ! edu ! au
[Download RAW message or body]

Ron Savage on  wrote...
| On Wed, 31 May 2006 10:39:57 +1000, Anthony Thyssen wrote:
| 
| HI Anthony
| 
| > Define the fill color and you should get the same results.
| 
| Yep, that fixed it. Thanx. I found 4 ways to do it from the command line.
| 
|
|  composite -dissolve 5x100 in.png white.png [-matte] out.png
|  composite -blend 5x90 in.png white.png out.png
|  composite -blend 5x90 in.png xc:white -resize 1024x768 out.png
|  convert in.png -fill white -colorize 95% out.png

Note disolve and blend are NOT quite the same though in most cases they
will have simular results, especially the the argument adjustments you
have made.  With those arguments the differences in results will only
become apparent when the image image also contains some transparent
and/or semi-transparent components.

The -colorize operator does not touch the alpha channel of the image
making it ideal for converting a image of some shape into a mask.

For example, rather than extracting a mask from an image using

  convert test.png  -channel +A -separate +channel -negate mask.png

An alturnative is to use -colorize like this...

  convert test.png -fill white -colorize 100% \
                   -background black -flatten   mask.png

Actually with this method you can make a mask of any color you like :-)
This can be useful in generating colorful shapes from transparency masks.

I have now add this to the IM Examples...
  Channels and Masks, Extracting a Mask form an Image
    http://www.cit.gu.edu.au/~anthony/graphics/imagick6/channels/#extract

Last example in section, a blue-ish 'mask' :-)


  Anthony Thyssen ( System Programmer )    <A.Thyssen@griffith.edu.au>
 -----------------------------------------------------------------------------
    Dragons have various degrees of flame at their disposal, ranging from
  ``toast a marshmallow'' to ``make a hole in a rock''.  You might want to
  keep that in mind next time you consider arguing with a dragon.
                                     -- Robert Asprin, "M.Y.T.H. Inc. Link"
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
Magick-users@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic