laigter
laigter copied to clipboard
[BUG] Dealing with large images crashes
platform ubuntu 19.10
problem Hello, First I want to congrats the dev for receiving the EPIC MEGAGRANTS. This tool is very powerful for a open-source one like godot engine. Okay, so i'm using very-large images like 4Kx4K or 8Kx8K, some images are like 36MB, to workaround this I use gimp to convert them into indexed color mode and it gets like 3mb, but Laigther still crashes. Related to #2
solution I was thinking about a "tile-loading-system" instead of loading all the image at once, the program load only tiles. I'm not sure if this is a good workaround but is what I have for the moment.
Hi!
First I want to congrats the dev for receiving the EPIC MEGAGRANTS
Thanks a lot!
Okay, so i'm using very-large images like 4Kx4K or 8Kx8K, some images are like 36MB, to workaround this I use gimp to convert them into indexed color mode and it gets like 3mb, but Laigther still crashes. Related to #2
Yes, this has been a problem since the beginning... could you share me one of the images to make tests? The problem seems to be a very high memory consumption. All opened images ares stored in memory, with the generated maps, neighbours, etc. But even though i think the consumption shouldn't be that high.
I was thinking about a "tile-loading-system" instead of loading all the image at once, the program load only tiles. I'm not sure if this is a good workaround but is what I have for the moment.
You mean loading the image by chunks, but still leave them stored in memory? If the problem is that Qt's images takes too much memory, or Opencv's mat, then idk if loading by chunks would help. Perhaps it could be made that no only images are loaded by chunks, but also they are processed by chunks... This however may broke the real time editting... We would need to test in a simple app if loading such an image also takes so much memory to discard that there is a problem elsewhere in the code. What do you think?
Thanks for anwesring.
Here's the image:
About chunk-loading: For example if you have a 32x32 image, divide it 8x8 load in memory only those divisions, and show-on-screen only 8x8 and them if the user wants to see another parts show other chunk and hide the previous one, only make normal mapping for that one that the user sees but when the user exports it compile all at once. plus You could use a technique called Pooling (in games it is called Object Pool) but for threads which results on Thread Pooling
Yeah, this could work. I need to think how to implement this currently in laigter.
Also, this should be investigated. https://wiki.qt.io/Loading_Large_Images
Im using load()
method, and that arcticle says i shouldn't
I could even use the QImageReaders to read chunks of the image.