jxl-oxide
jxl-oxide copied to clipboard
High ram usage with decodint to png high resolution, lossless jpeg recompression
Example image: https://files.catbox.moe/2kdb4f.jxl source image: https://dolphin-emu.org/m/user/blog/progress-report/2016-november/windwaker35xnative.jpg
has dimensions of 23164x18480, currently decoding this quickly leads to OOM, this was made with lossless jpeg recompression, I dont have the ram to compress it without using that.
Currently jxl-oxide allocates buffer for the whole image when decoding to image (this means ~5GB of memory for a single three-channel 23164x18480 frame). Maybe we need a streaming decode option...
A few thoughts on this issue:
- For some images, it might be inevitable that the memory usage is high; we need to keep full framebuffers if they are used for blending. Optimizing cropped decoding would be helpful in this case (by requesting multiple cropped renders to produce the full image).
- Improving caches might help reducing memory usage, but I haven't investigated on this.