Page 1 of 1

Expected behavior? (MagickColorizeImage)

Posted: 2007-10-29T13:35:00-07:00
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.