Page 1 of 1

writing area on big picture without loading the image into memory

Posted: 2018-11-16T14:43:34-07:00
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.

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

Posted: 2018-11-16T15:30:48-07:00
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/