MagickColorizeImage PixelWands

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
ReachingFarr

MagickColorizeImage PixelWands

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: MagickColorizeImage PixelWands

Post 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");
iSage
Posts: 14
Joined: 2015-03-02T13:03:49-07:00
Authentication code: 6789

Re: MagickColorizeImage PixelWands

Post by iSage »

Sorry for bumping old thread, but why is opacity actually set by color and not by PixelSetAlpha/PixelSetOpacity?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: MagickColorizeImage PixelWands

Post 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
snibgo's IM pages: im.snibgo.com
Post Reply