-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize jxl/avif motion pictures #189
Comments
Thanks for reporting and attaching images! Avif animations are not yet supported, only jxl and gif have animation support. |
Thanks for the reply. Maybe you can refer to the scheme used by JPEGView. I have tried almost all image viewers recently and only JPEGView supports jxl/avif perfectly and has excellent performance, displaying jxl/avif with almost 0 latency. |
I actually just switched from the I've already looked at decoding frames in parallel, but had no luck so far. Maybe there are other tricks which make the experience better. I am happy to work on avif animations in the future. |
Good news, I rewrote the animation handling and now send the first frame as soon as it's loaded. This was a bit tricky as I need to compensate frame delays with the time it actually took to decode the frame. This touches all other loading code, so I will have to test this a bit before releasing. |
Good. I'll add some other feedback on use. 1, the window size seems to only revert to the size of the last time the window was opened, the window size can be adjusted with the mouse, but it does not affect the image display. This does not make sense. 2, Cleaner UI I have three scenarios for using the image viewer. 1, quick view. 2, comic mode. 3 professional image viewer with editing capabilities. 3, it takes up too much memory. 4, can we use asynchronous solution like rayon library when decoding multi-frame pictures?
|
This is dependent on the use case. I've had feedback that people don't want their image to be scaled (if they are picking a color for example) when the window is resized. This could be an option of course. In general, Oculante is more geared towards power users/image professionals, but I am happy to do changes that fit a different audience.
This is great feedback.
I am not sure how memory consumption reflects performance. I'd need to dig deeper into concrete examples/benchmarks. I am sure mpv is much more optimized for video playback, where Oculante is not. It was originally made to persist frame data for non-destructive editing, and also caches images, which mpv does not. This can increase memory consumption quite a bit, but it is comparing apples with oranges. |
I tested opening a 30KB jpg image with oculante and it used 567MB of memory. No matter what method is used to parse this jpg, it does not use this much memory. And the folder where the jpg is located only has this one image, so this is not a pre-reading or caching usage either. |
Just tried oculate from the last release on linux While viewing the same 300Kb jpeg image,
I don't get such a big difference in memory consumption. |
I could also not reproduce this, at least not on Mac & Linux. There are some things embedded in Oculante such as a font with wide language coverage and icons which bring the base memory to about 30MB, but opening a small jpeg should just use a couple of MB - basically the size in pixels times 4 channels times 8bpp. This is loaded, plus cached, plus put into a texture - so you would roughly see 30MB app memory plus 3 times the decoded image. And yes, there could be optimisations done! On a note, the size of a jpeg on disk, like your example of 30kB image, is rather meaningless. You can easily create a 85x85px jpeg with 30kB size, and a 2300x2300 jpeg that is also 30kB - both are "small" but have drastically different memory usage - the first uses ~30kB mem, the latter ~20000kB: If you believe you found something unusual, I'd kindly ask you to upload a sample picture, preferably in a separate issue, and describe oculante version and operating system so I can try to reproduce that. |
I have already provided my system information before - WIN 10 64, if you can't in testing this platform, uploading images is pointless. I forget where that jpg is saved, but I'm sure it's about 500*500 in size. |
|
Oculante uses a library that is similar to a game engine to draw part of its UI. It has an update loop which runs all the time. On all systems except Windows, there is a Line 70 in 4001c87
|
I can't provide any more debugging information. But I'm sure that other software opens both images fine. And, no matter how many times they are opened, the memory used by these software does not change. AutoHotkey => ~4MB |
Open a 3.4MB gif image and open it with almost no delay.
Convert this gif to a 700KB jxl image and open it will have a 2-3 second delay.
Convert this gif to a 270KB avif image and oculante cannot open it, it is always in the "loading" state. Of course this avif image will play normally in chrome.
test-img.zip
win-10 64
The text was updated successfully, but these errors were encountered: