Page 1 of 1

MagickColorizeImage PixelWands

Posted: 2007-02-07T17:21:07-07:00
by ReachingFarr
I was wondering if anyone could explain what values I should set in the Pixel Wands I am passing to MagicColorizeImage. Right now, with the values I'm setting nothing appears to be happening.

Thanks.

Re: MagickColorizeImage PixelWands

Posted: 2007-02-07T17:51:49-07:00
by magick
Here's a code snippet to tint an image red:

Code: Select all

  magick_wand = NewMagickWand();
  MagickReadImage(magick_wand, "logo:");
  colorize = NewPixelWand();
  opacity = NewPixelWand();
  PixelSetColor(colorize,"red");
  PixelSetColor(opacity,"#222");
  MagickColorizeImage(magick_wand,colorize,opacity);
  MagickWriteImage(magick_wand,"logo.png");

Re: MagickColorizeImage PixelWands

Posted: 2015-10-17T13:40:00-07:00
by iSage
Sorry for bumping old thread, but why is opacity actually set by color and not by PixelSetAlpha/PixelSetOpacity?

Re: MagickColorizeImage PixelWands

Posted: 2015-10-17T14:52:15-07:00
by snibgo
I suppose you are referring to "MagickColorizeImage(magick_wand,colorize,opacity);" The "opacity" there is an argument to the function. It refers to the degree of the effect, not the opacity of the final pixels. See also http://www.imagemagick.org/script/comma ... p#colorize