Dustin Senos on  wrote...
| Dustin Senos <[EMAIL PROTECTED]> sent the following
| comment to "anthony", about "RGB to Luminance conversion".
| You are reading it:-
| ------------------------------------------------------------
| Hi Anthony,
|
| I truly appreciate all of the work you have put into Image Magick
| source and documentation. There aren't a lot of good people out there
| who do things for free. Thank you.
|
| I am attempting to "tint" a image to greyscale in both Adobe Flash +
| Image Magick. Using -colourize method in IM it appears to map all
| white points to the color you pass in. I supply red, white is now red.
| I would like to keep white 255/255/255 and black 0/0/0 but map all the
| colors between.
|
-colorize takes the fill color, makes it semi-transparent by the amount
you specified using -colorize, and overlays it onto the image.

I say as much in IM Examples where I use colorize for greying
(de-normalizing or de-contrasting) grayscale.

What you describe is '-tint' which greys greys, leaving white and black,
and primary colors alone.  (It is actually greyscale function)

| I see examples on how to do this using gradients or -tint, but I have
| a question for you. The flash script I use, uses a RGB to Luminance
| conversion when converting to grey scale. I am using Charles A.
| Poynton's   conversion standards to do so:
|
| r_lum:Number = 0.212671; g_lum:Number = 0.715160; b_lum:Number =
| 0.072169;
|
Blue is very dark!

| Is there any way to convert / tint a image using the same method in
| Image Magick?
|
As I mentions tint is a gray scale function, it ignores brightness or
luminence, and just applys the color in terms of a vector for each of
the RGB channels.   If you want otherwise you will need to DIY it.

Try this...
Get the luminance greyscale image, map it with the -tint quatratic
function so white and black => black and grey => white.  Then use that
as a alpha mask for the color you want, which you then overlay on the
image you want to tint.

Hmmm...
  convert image.png \( +clone -matte \
             -channel A -fx 'lum=(luminosity)-.5; (1-4*lum*lum)*a*.7'
             +channel -colorize red \) -composite    lum_tinted.png

Note this is my own suggestion is is a little different to -tint
The .7 in the formula is the equivelent of the 'tint' argument
though in this case it will not 'darken' as ' tint with white' will.

Remember this is an overlay tinting method, not a wierd -tint formula
the exact mechanics of which I have not figured out.

I have added this to the IM Examples 'Color' page.


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
  You are all under arrest!   Place your manipulative members above your
  sense-organ clusters and proceed hence.   -- Keith Laumar - "Retief's War"
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to