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.
Conversion of UIImage to Image* in iOS
Re: Conversion of UIImage to Image* in iOS
Code: Select all
UIImage *sourceImage; // Your UIImage
NSData *imgData=UIImagePNGRepresentation(sourceImage);
MagickReadImageBlob(mw, [imgData bytes], [imgData length]);
Image *image=GetImageFromMagickWand(mw);