简体   繁体   中英

Save an image to disk without using all the ram

I work processing really big images of the likes of GIS and Astronomy images. I need to find a library preferably in python that allows me to append bits to an image and write it piece by piece to disk without having to have all the image in RAM at once.

Edit: Thanks to those who commented. I work with microscopy images. Mostly those that can be opened with Openslide . Some of them are in this list . My goal is to have just one big file containing an image, a file that can be opened by other people instead of having a bunch of tiles.

But unless I have lots and lots of RAM (which I don't always have and people don't always have) I can't create images as big as the original and store them with things like PIL.image. I wish I could create an initial file, and then append to it the rest of the image as I create it.

Just like with GIS and AStronomy, microscopy has to create images based on the scans, and process them, so I was wondering if anyone knew a way to do this.

I don't think that's totally possible. to use data, a computer copies it to RAM. If you just want to append your data to your image, use PIL.Image

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM