Creating the color-in book filter with MagickWand
Posted: 2011-06-28T23:07:23-07:00
I'm trying to recreate the effect here: http://www.imagemagick.org/Usage/photos/#color-in with the identical effect in MagickWand.
Here's the command I want to duplicate in with MagickWand:
I've been having a good deal of trouble properly converting this command, but I think it's mostly due to the fact that I can't find a way to translate the command to a MagickWand function. Also, the value being passed to -edge, 1, seems to be too small. The effect is no where near what I think it ought to look like unless I bump this value up to around 20.
The code I've been working with has variables attached to sliders, so that i can change their value on the fly and regenerate the image. Heres the code:
Any help figuring this one out is GREATLY appreciated! Thanks.
Here's the command I want to duplicate in with MagickWand:
Code: Select all
convert holocaust_sm.jpg \
-edge 1 -negate -normalize \
-colorspace Gray -blur 0x.5 -contrast-stretch 0x50% \
color-in.gif
# For heavily shaded pictures...
# #-segment 1x1 +dither -colors 2 -edge 1 -negate -normalize \
Code: Select all
-contrast-stretch 0x50%
The code I've been working with has variables attached to sliders, so that i can change their value on the fly and regenerate the image. Heres the code:
Code: Select all
status = MagickReadImageBlob(magick_wand, [dataObject bytes], [dataObject length]);
status = MagickEdgeImage(magick_wand, edgeRadius);
status = MagickNegateImage(magick_wand, MagickTrue);
status = MagickNormalizeImage(magick_wand);
status = MagickSetImageType(magick_wand, 2);//gray colorspace
status = MagickBlurImage(magick_wand,blurRadius, blurSigma);
size_t my_size;
unsigned char * my_image = MagickGetImageBlob(magick_wand, &my_size);....