Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Unable to redner BIG png image #327

Open
simoneruffini opened this issue Apr 4, 2021 · 11 comments
Open

Unable to redner BIG png image #327

simoneruffini opened this issue Apr 4, 2021 · 11 comments

Comments

@simoneruffini
Copy link

simoneruffini commented Apr 4, 2021

I have a png image of about 163 MB and imv is not able to render it. It just displays a big white backgroung (that is the main color of the image). I can open the image in the browser (firefox), it takes some time but it manages to do that.

Additional info:
-version: v4.2.0
-os: Linux DellXPS 5.11.11-arch1-1 #1 SMP PREEMPT Tue, 30 Mar 2021 14:10:17 +0000 x86_64 GNU/Linux
-wayland

If you need the image I'll try to upload it somehow (my internet connection is very limited in bandwidth)

@simoneruffini simoneruffini changed the title Unable to redner BIG jpg image Unable to redner BIG png image Apr 4, 2021
@simoneruffini
Copy link
Author

I tried compressing the image with image magic to a smaller size and to jpg but still same result.
Then I exportied the original (from krita) directly in jpg, now the file size is 92MB. No render even with that size. Then i converted it through imagemagick (magick back1.jpg -strip -interlace Plane -sampling-factor 4:2:0 -quality 50% back.jpg) still no success. Now the image is 11MB.

@GbGp
Copy link

GbGp commented Apr 9, 2021

I can replicate this, for example:
https://esahubble.org/images/heic2007a/
I can open the "Publication TIFF 10K" version (163 MB, 10000x6871), but not the fullsize version (520 MB, 17043x11710).
No problem when opening with gimp.

@simoneruffini
Copy link
Author

I got the same problem with other images. All of them have weird proportions and a lot of pixels, e.g: 24918x9920.

@GbGp
Copy link

GbGp commented Apr 10, 2021

Reading the source it looks like the picture is rendered directly as an opengl texture. I don't know anything about opengl but obviously there is a maximum size that depends on the gpu.
Not sure what make more sense for this project, but I am guessing that at very least the renderer should be provided with a copy of the input pic with resolution clipped to GL_MAX_TEXTURE_SIZE.

@eXeC64
Copy link
Owner

eXeC64 commented Apr 14, 2021

Years ago when I first wrote imv it used multiple power-of-two sized textures to display the image. I don't remember the reasons for switching to a single-power-of-two texture, but I recall it supporting everything I tried at the time on the devices I had to test with.

I suspect drivers are smart enough that if they're failing for certain images, they won't succeed for multiple textures of an equivalent total size being showed simultaneously. Downscaling and only displaying full resolution when zoomed into a smaller area of the image is probably the required solution, but that adds a lot of implementation complexity.

@simoneruffini
Copy link
Author

simoneruffini commented Apr 16, 2021

Ok so this means that imv does not support certain resolutions, right? Hence, which resolutions are supported? And does this means that this issue is a #wontfix?

@akimdi
Copy link

akimdi commented Apr 16, 2021

@eXeC64
@simoneruffini
I also have the same problem, but I don't need to have a large image.
P.S. image 4Mb
114320803-05936c00-9b18-11eb-8d97-2fb0bfb95637
.

@akimdi
Copy link

akimdi commented Apr 16, 2021

@GbGp
Copy link

GbGp commented Apr 18, 2021

@simoneruffini
The maximum picture size hardware/driver dependent, for example on my machine it's 16384x16384.

Similar problem
ArturKovacs/emulsion#99

Didn't have time to look at this in detail, but it looks like they are fixing the same issue by tiling the image in smaller texts.

@akimdi
Copy link

akimdi commented May 1, 2021

@eXeC64
Copy link
Owner

eXeC64 commented Jul 8, 2021

It's not a wontfix, the rendering just needs to be refactored to use multiple smaller textures when the image is too big for a single. I'm happy to review PRs, I just have very limited time to write code for imv myself currently.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants