Convert a JPG to RGB array from a handle in memory

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jeffcraighead

Convert a JPG to RGB array from a handle in memory

Post by jeffcraighead »

I just want to know if this is possible and which function to call to do it if so. I've got a stream of JPGs from an image server that broadcasts on a multicast address. I want to use IMs C API to convert the JPG images which are in memory to RGB arrays for use in a larger .NET application by wrapping the necessary API function calls.

Thanks!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Convert a JPG to RGB array from a handle in memory

Post by magick »

MagickCore provides BlobToImage() which accept in-memory image formats. You can then extract pixels with AcquireImagePixels() or ExportQuantumPixels(). There should be analogs to these methods in the other ImageMagick progamming interfaces (e.g. MagickWand, Magick++, etc.).
jeffcraighead

Re: Convert a JPG to RGB array from a handle in memory

Post by jeffcraighead »

Thanks, that's just what I was hoping for.
Post Reply