Page 1 of 1

Conversion of UIImage to Image* in iOS

Posted: 2013-07-29T00:31:45-07:00
by anachn91
I have a UIImage on which I am trying to apply auto gamma correction using the function: AutoGammaImage(Image *).
When I pass the UIImage directly to the function after bridge casting, I get the following error:

Assertion failed: (image->signature == MagickSignature), function GetImageChannelMean, file magick/statistic.c, line 1215.

Please tell me how should I convert the UIImage to an Image* for passing to this function.

Re: Conversion of UIImage to Image* in iOS

Posted: 2014-01-03T01:29:54-07:00
by mrugraj

Code: Select all

UIImage *sourceImage; // Your UIImage
    NSData *imgData=UIImagePNGRepresentation(sourceImage);
    MagickReadImageBlob(mw, [imgData bytes], [imgData length]);
    Image *image=GetImageFromMagickWand(mw);