Question: OOM during composite and write large PNGs
See original GitHub issueI am trying to write large PNGs (its on a Kubernetes node with 8GB RAM).
- I seem to be able to write large PNGs (e.g. 70MB on disk) by taking a single “small” sample PNG and writing it multiple times to a large output image using
.composite
- In my application, when i try to stream many PNGs and composite them onto a large output image it OOMs.
My question is about expected behavior and what is the pattern to do this … should it be possible to composite any number of “small” images streamed (i.e. loaded from S3 into memory one image at a time) and composite them onto a large output image and save to file? Assume these “small” images are much smaller in memory than 8GB.
I had assumed the the write would sequentially write out the PNG without holding the streamed images in memory but i must be mistaken? It is confusing to me right now that my first test that writes a single PNG works but my true test of writing out different images does not.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Flutter easily composite / overlay PNG images from the assets ...
Use canvas.drawAtlas in my own Painter; use the image library (which seems a bit overkill in this case. Couldn't find any working example...
Read more >How to insert multiple images in one figure using LaTeX? - TeX
You can just put multiple \includegraphics commands into your figure environment. Keep it mind that figure is just a logical, ...
Read more >Displayables — Ren'Py Documentation
When a Ren'Py function or variable expects a displayable, there are five ... image eileen composite = Composite( (300, 600), (0, 0), "body.png",...
Read more >RFC 2083 - PNG (Portable Network Graphics) Specification ...
This specification defines the Internet Media Type image/png. ... display device they are using and room lighting, to present the image to the...
Read more >JPEG vs. PNG: Which one should you use? - Adobe
JPEG and PNG are two of the most widely used image file formats. ... between JPEGs and PNGs and find out when to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The disc threshold is the size of the uncompressed image, so width * height * bands * sizeof( element ).
You can put the unit after the number, so eg. “1gb”, “10mb”, “100kb”, etc.
There’s a page in the docs covering libvips image opening which gives some background:
https://www.libvips.org/API/current/How-it-opens-files.html
This looks useful! are both available also for python scripts? Could you please share what units for
VIPS_DISC_THRESHOLD
are used (MB or pixels)?