writing area on big picture without loading the image into memory

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
eitanmiz
Posts: 8
Joined: 2018-11-12T15:06:01-07:00
Authentication code: 1152

writing area on big picture without loading the image into memory

Post by eitanmiz »

Hello,

I have a picture of 1000k x 1000k pixels.
The picture may come in format jp2 or tif.

I want to write a block of area, i.e 30k x 30k on the big picture (don't has to be that size exactly - if I can write to specific areas, such as tiles - it's ok), without load the picture into memory.

I heard about tiles (the picture is actualy breaking parts of it), so I can handle each tile seperately.
I don't know much about tiles and how doing that.

I need solution for C# that can load the only specific part into memory and can save that part back into the big picture file.

How can I do that?

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

Re: writing area on big picture without loading the image into memory

Post by snibgo »

What are these huge images?

IM can do the job using disk to store the pixel cache. Of course, you need a large disk, many TB.

IM can do it without loading the image into memory provided the input is mpc format. But mpc is an internal IM format, so that transfers the problem: converting to and from mpc.

IM can read part of the image eg "input.jpg[30000x30000+120000+150000]" but I don't know how much memory that needs.

I suspect another tool such as VIPS would handle this more easily. See https://jcupitt.github.io/libvips/
snibgo's IM pages: im.snibgo.com
Post Reply