Resizing raw byte array?

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
i73
Posts: 50
Joined: 2016-08-24T11:30:27-07:00
Authentication code: 1151

Resizing raw byte array?

Post by i73 »

I'm currently exporting my images in raw byte array data, 0-255. Is there a way I could resize this (With the width, height and stride) or would I have to convert it to a bitmap then run it through IM? Would I also be able to convert it with IM? Then resize?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Resizing raw byte array?

Post by snibgo »

IM contains no facilities that will resize an image that is contained in your array, because IM knows nothing about the structure of your data.

However, you can convert that data into an IM "Image" data structure, then do whatever IM operations you want such as resize, then convert it back.

See pixel.h ImportImagePixels() and ExportImagePixels().
snibgo's IM pages: im.snibgo.com
Post Reply