We have an image processing windows application where we are using lead tools for converting and images from 24/48 bit images to 8 bit images.
As an experiment I’m porting the application to iPad using MonoTouch and C#, now the LeadTools components are incompatible with Monotouch. Is there any alternate I can use? if not how can I convert 24/48 bit images to 8 bit?
To use Apple’s imaging tools here is where I would start:
Convert your raw bytes into a pixel format supported by the platform. See the Quartz 2D documentation on supported pixel formats.
Note that iOS doesn’t currently have a 24 or 48 bit format. However, if your 24 bit format is 8 bits per channel (RGB) you could add 8 bits of ignored alpha. (Alpha options are in MonoTouch.CoreGraphics.CGImageAlphaInfo)
Convert your raw bytes into a CGImage. Here is an example of how to do that
Use a Core Image Filter to convert to Monochrome
Finally you can retrieve the raw bytes of that image by drawing into a CGBitmapContext constructed according to your desired parameters.
I suspect this pipeline could be optimized, but it is a place to start. I’d be interested to hear what you end up with.