Page 1 of 1
Jpeg2000 Massive Image Conversion - Part 2
Posted: Tue Apr 18, 2023 1:01 am
by pinchies
(this bug also applies to XnConvert)
Dear Pierre,
Following on from the
previous bug, most large JP2 files are now opening correctly for me. However, some of the extremely large ones are still failing to open. An example is attached below:
Massive JP2:
https://www.dropbox.com/s/cq6x5wzxzzvck ... 2.jp2?dl=0
Many thanks.
Re: Jpeg2000 Massive Image Conversion - Part 2
Posted: Thu Apr 20, 2023 6:41 pm
by masterjp
I tried your jpeg 2000 file with XnviewMP.
It is possible to view the file in browser window, but you need much RAM and it is very slow!
My computer (16 GB RAM) needs several minutes to load the file
and uses the full size of 16 GB RAM and a big swapfile (24 GB)!
Check your Windows settings for virtual ram (swapfile/pagefile).
I set it to auto size.
The Freeware tool IrfanView 4.62 (Picture viewer) is a little bit faster.
It uses around 2 GB RAM to load the file.
Zwischenablage-1.jpg
Re: Jpeg2000 Massive Image Conversion - Part 2
Posted: Fri Apr 21, 2023 7:57 am
by nji9
+1
If XnViewMP uses 40 GB (16 + 24) to load a jp2000 file,
where IrfanView (64 bit) does it with 2 GB,
that seems to be a big bug in XnViewMP/ jp2000 decoder.
(BTW IrfanView doesn't only show the images but transforms
them into an internal representation too and offers
many manipulations of it, just like XnViewMP).
Re: Jpeg2000 Massive Image Conversion - Part 2
Posted: Fri Apr 21, 2023 8:52 am
by masterjp
I think it is not a bug of XnViewMP or the jpeg2000 decoder.
All professional programs (adobe photoshop, etc.) try to use the whole free ram for faster access the picture and will use the swapfile, if free physical ram is missing. If you work with picture files with so big pixel sizes, it is recommend to have 32 or more physical RAM installed in your computer!
Irfanview use fewer Ram to load the file. Maybe it is possible to limit the ram usage, but more ram should load the picture file faster.
Re: Jpeg2000 Massive Image Conversion - Part 2
Posted: Fri Apr 21, 2023 9:32 am
by nji9
masterjp wrote: Fri Apr 21, 2023 8:52 am
[...]
Irfanview use fewer Ram to load the file. Maybe it is possible to limit the ram usage, but more ram should load the picture file faster.
But didn't you state that IrfanView uses much less RAM and still loads faster than XnViewMP???
(I tried myself with GIMP (64 bit), but with only 8 GB of RAM wasn't able to load the image).
Re: Jpeg2000 Massive Image Conversion - Part 2
Posted: Fri Apr 21, 2023 2:00 pm
by pinchies
Sorry, this is my mistake. I was trying to open this large image on my 16GB Macbook air, which was the real problem for this one. I was able to open some very *slightly* smaller images with no problem in XnView/XnConvert on that same machine (albeit, slowly), but opening this one took so so much longer that I had mistaken this for image for having frozen the computer.
This image does open on my home PC, where it uses a total of
49.5GB of RAM, and
took a few minutes to open using 20 cores of CPU.
Meanwhile, I was able to open the very same image on the Macbook using the built-in image viewer, 'Preview', in about
4 seconds, with no noticable ram usage increase. Apple uses the Kakadu library internally in their Preview image viewing application, which unfortunately is the gold standard at this time. I commented a little about JPEG2000 engines in my
last post.
It does appear the
Grok JPEG2000 engine (which is a fork of the OpenJPEG JPEG2000 engine used in XnView, which in turn was replacing the old old Jasper engine before that) does offer better performance, but it might be too much effort to replace the engine in XnView for this, I don't know.
When I tried to open this in irfanview, it only uses ~3GB of ram, but it also seems to fail to decode the bottom half of the image!
Re: Jpeg2000 Massive Image Conversion - Part 2
Posted: Wed May 03, 2023 2:21 pm
by xnview
it's not a bug of XnView, OpenJPEG needs 22GB to decode this file... XnView needs 5GB for image datas
Re: Jpeg2000 Massive Image Conversion - Part 2
Posted: Wed May 03, 2023 5:08 pm
by pinchies
Thanks Pierre. I have been actually experiencing some strange crashes converting large JP2 images with lancoz scaling... trying to find a repeatable case to send through. But things are certainly working far better now, and when I convert images on my workstation (128GB ram) then 9/10 times things go through perfectly first time.