Expected behavior? (MagickColorizeImage)

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
mkoppanen
Posts: 309
Joined: 2007-06-09T07:06:32-07:00

Expected behavior? (MagickColorizeImage)

Post by mkoppanen »

Code: Select all

#include <stdio.h>
#include <string.h>
#include <wand/magick-wand.h>

int main()
{
	MagickWandGenesis();

	PixelWand *color_wand = NewPixelWand();
	PixelWand *opacity_wand = NewPixelWand();
	MagickWand *magick_wand = NewMagickWand();

	MagickReadImage( magick_wand, "magick:logo" );
	
	/* no effect */
	// PixelSetColor( color_wand, "red" );
	// PixelSetOpacity( opacity_wand, 0.5 );
	// MagickColorizeImage( magick_wand, color_wand, opacity_wand );

	/* this works */
	PixelSetColor( color_wand, "red" );
        PixelSetOpacity( color_wand, 0.5 );
	MagickColorizeImage( magick_wand, color_wand, color_wand );

	MagickSetImageFormat( magick_wand, "png" );
	MagickWriteImage( magick_wand, "/home/mikko/public_html/image.png" );
	


	MagickWandTerminus();

	return 0;
}
Using different pixelwands for parameters in MagickColorizeImage seems to do nothing. Using the same wand for both parameters seems to be working fine.

I found no note of this behavior in docs.
Mikko Koppanen
My blog: http://valokuva.org
Post Reply