Partial read/write

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
peter01242
Posts: 17
Joined: 2016-06-22T11:32:57-07:00
Authentication code: 1151

Partial read/write

Post by peter01242 »

Is it possible, using IM 7.0.2-Q8 on Windows to perform a partial read/write on a file?

The reason I ask is that I need to add bar-codes to (potentially very large) images and would prefer to be
able to read just the area of the image I need, composite the bar-code and write back the modified data
to the original image.

Ideally it would be useful to 'read' the file information from the file, to determine the size, prior to
initiating the partial read.

Any suggestions or should I look elsewhere?

Peter Young
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Partial read/write

Post by snibgo »

I think IM can read only a certain rectangle from an image in a file, without reading all the other pixels into memory.

But the other end of the process is harder. I don't think it can update a rectangle of pixels in a file, without also reading the other pixels.

Well, I suppose it can for its own internal MPC format. But not in the general case.

What format are your images in? If non-compressed, so it's easy so find the file bytes that define an area, a hack could be written to read those bytes and make an image. Then, in the other direction, overwrite those file bytes.
snibgo's IM pages: im.snibgo.com
Post Reply