0.84: Thumbnail of large images are dark

Reported bugs that have been closed and/or resolved

Moderators: XnTriq, xnview, Dreamer

Post Reply
User avatar
helmut
Posts: 8145
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

0.84: Thumbnail of large images are dark

Post by helmut » Wed Mar 08, 2017 10:31 am

XnView: MP 0.84 - 64-bit
OS: Windows 7 - 64-bit

When browsing a folder with very large images (e.g. 20.000 x 20.000 pixels), the thumbnails of these images are dark in brightness.

Effect: Thumbnails aren't displayed properly

To reproduce:
1. Download the attached PNG images and save them locally
2. Start XnView and browse the folder with the image files
Actual behaviour (bug): XnView builds the thumbnail. Thumbnail do not look the same: The thumbnail of the large image looks dark in brightness and somehow corrupted. :bug:

Expected behaviour: XnView builds the thumbnail. Both thumbnails look the same.

Notes:
• If the problem should not occur, try converting the large image to BMP format. If the problem still doesn't occur, resize the large image to 40.000x40.000 pixel with "Resizing: Nearest neighbor" and try, again.
• This problem might be related to following problems:
- 0.84: Problems when navigating over large image files
- 0.84: Resizing to large image fails silently
Attachments
1000px.png
1000px.png (6.58 KiB) Viewed 417 times
20000px.png

CameronD
Posts: 299
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: 0.84: Thumbnail of large images are dark

Post by CameronD » Thu Mar 09, 2017 2:03 am

Very odd indeed:
It is as if there is a V-shaped or saw-tooth curve mapping - darker to mid colours are OK, but then very pale tones get darker.
Also, there is a one or 2 pixel shift at some stage giving it a raised or depressed button effect edging. (wrong - see later post)
In the main body of the bug every square is OK except the palest.
xnview-20kpng-preview-bug.png
screenshot showing thumbnail (top) and preview tabs in xnviewMP.
Last edited by CameronD on Thu Mar 09, 2017 7:12 am, edited 1 time in total.

User avatar
XnTriq
Moderator & Librarian
Posts: 5319
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: 0.84: Thumbnail of large images are dark

Post by XnTriq » Thu Mar 09, 2017 4:00 am

:bugconfirmed: for 20000px.png and the following config:
  1. ToolsSettings...ThumbnailMiscCreate high quality thumbnail is activated
  2. ToolsSettings...ThumbnailAppearanceCustom thumbnail size is activated and Width/Height < 168 pixels
  3. ToolsSettings...CatalogCatalogEnable thumbnail caching is turned off
Additional bug to be reported separately ASAP: Turning off Create high quality thumbnail doesn't work for 4-in-1 thumbs (Show 4 thumbnails in folder's thumbnail (instead of 1)).

CameronD
Posts: 299
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: 0.84: Thumbnail of large images are dark

Post by CameronD » Thu Mar 09, 2017 4:02 am

Here's a better example: screenshot and test image.
The edge effect I mentioned above is simply because of the previous enlargement operation combined with the bug. I cannot find any way to make an enlargement that produces an exact reproduction of the image - for an N-times enlargement, photoshop and xnview always want to create an N-pixel boundary that is interpolated from all sides.

The test image has several grey or nearly grey ramps from black to white.
I can reproduce with thumbnails set to zip or jpeg high quality.

The screen shots show that there is a sawtooth greyscale remapping applied. The thumbnails with increasing size images show that the adjustment point changes with the image size.
xnview-26kpng-greyramp-bug.png
screenshot of thumbnails and preview
I did another test (not shown here, and by reducing only the width of the image I can see that the sawtooth corresponds to the number of vertical pixels.

18000 pixels high is OK, 19500 is bad, 19000 is bad.
(this is misdiagnosis - see later post)

The bad image is attached.
Attachments
grey-test-26k-NN.png
large greyscale ramp, including scale with slight colour offsets
Last edited by CameronD on Thu Mar 09, 2017 7:14 am, edited 1 time in total.

CameronD
Posts: 299
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: 0.84: Thumbnail of large images are dark

Post by CameronD » Thu Mar 09, 2017 5:35 am

XnTriq wrote::bugconfirmed: if Create high quality thumbnail is activated.

BTW: Turning off Create high quality thumbnail doesn't work for 4-in-1 thumbs (Show 4 thumbnails in folder's thumbnail (instead of 1)).
Edit: This is all only misinterpretation of the symptoms - see following post.
I originally wrote:
I confirm that disabling of high quality almost eliminates the bug - the thumbnails for individual images in the browser window are good whether 4-in-1 is chosen or not - only the thumbs in the 4-in-1 are very dark.

Looking at it from another viewpoint - for 1 thumb per folder icon: the thumbnail created inside the folder icon will be bad, no matter what the setting is for Create high quality thumbnail . This applies whether or not a good thumbnail of the representative image has already been created and cached. BUT the thumb in the folder is GOOD if thumbnail caching is disabled. :?
If I enable high quality AND caching AND 4-in-1 folder icons then the sawtooth mapping that is applied is different from that applied to each individual image! Some large images that generate correct individual thumbs will produce bad thumbs in the 4-in-1 folder.

Alternatively, even with high quality enabled:
disabling caching of thumbnails produces good individual thumbnails;
enabling caching of thumbnails produces the same bad thumbnail, independent of compression storage chosen (even "None").

For each test, I would change cache mode, exit xvniewmp, delete the thumbs.db file and restart xnviewmp.
Last edited by CameronD on Thu Mar 09, 2017 7:16 am, edited 1 time in total.

CameronD
Posts: 299
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: 0.84: Thumbnail of large images are dark

Post by CameronD » Thu Mar 09, 2017 7:10 am

More complications:

The same image will produce problems, but if rotated by 90 deg will produce a different image, as shown here:
xnview-bigfile-thumbnail-bug-rotation.png
The top left shows what it should look like (it is an 8-bit greyscale png). Top-right shows that rotating it without changing total pixel numbers triggers the bug.
The bottom row has double the number of vertical and horizontal pixels, and the left one has two step changes in the remap, while the right one has five.

The light creeps in:
Then I changed the thumbnail size - original was 192x144.
If I change it so that the X and Y size is the same, then the bad images are transformed in the same way.

The critical factor seems to be the ratio between image pixel dimension and thumbnail pixel dimension, and the magic number seems to be 128. Once the image needs to be reduced by more than that factor in either direction then it goes bad.

This explains why 4-in-1 and thumbs embedded in folder icons gave weird results: they are reduced by different amounts in each case, although it seem strange that the cached thumbnails are not used as a starting point - it would be much faster.

Also explained is why disabling thumb caching seemed to work - it seems to simply default to initially produce a thumb size determined by the current view. As I later found, a really large image will still produce a bad image with caching disabled. The default is also unequal in X and Y.
Last edited by CameronD on Thu Mar 09, 2017 7:21 am, edited 1 time in total.

CameronD
Posts: 299
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: 0.84: Thumbnail of large images are dark

Post by CameronD » Thu Mar 09, 2017 7:19 am

XnTriq wrote: Additional bug to be reported separately ASAP: Turning off Create high quality thumbnail doesn't work for 4-in-1 thumbs (Show 4 thumbnails in folder's thumbnail (instead of 1)).
If my final interpretation is correct, then this is all part of the same bug.

User avatar
helmut
Posts: 8145
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: 0.84: Thumbnail of large images are dark

Post by helmut » Thu Mar 09, 2017 9:19 am

Thank you very much, XnTriq and CameronD for your many tests and detailed description of your observations! Good that you both could reproduce the problem - let's see whether Pierre also can.

:arrow: Reproduced

User avatar
xnview
Author of XnView
Posts: 30214
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.84: Thumbnail of large images are dark

Post by xnview » Sat Jul 08, 2017 1:04 pm

This problem is supposed to be fixed in XnView MP 0.87. Please check and confirm the bug fix here.
Pierre.

CameronD
Posts: 299
Joined: Wed Aug 01, 2007 1:28 pm
Location: Australia

Re: 0.84: Thumbnail of large images are dark

Post by CameronD » Mon Jul 10, 2017 2:50 pm

Version 0.87 beta 1 - all my test thumbnails now look like they should (after waiting for them all to be rebuilt!).
However, the 4-in-one folder thumbnails still have the problem. This is even if I visit the lower folder first, allow the correct thumbnails to be cached and then visit the folder above. It seems to reprocess the original images to derive the 4-in-one thumb, rather than using available thumbnails, which accounts for the very long time (a few minutes) it takes to create them.

I have deleted cached thumbnails and forced a rebuild just to confirm I was not seeing leftovers from the bugs of the previous version.

User avatar
XnTriq
Moderator & Librarian
Posts: 5319
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: 0.84: Thumbnail of large images are dark

Post by XnTriq » Fri Jul 21, 2017 2:30 am

CameronD wrote:Version 0.87 beta 1 - all my test thumbnails now look like they should (after waiting for them all to be rebuilt!).
Confirmed
CameronD wrote:However, the 4-in-one folder thumbnails still have the problem. This is even if I visit the lower folder first, allow the correct thumbnails to be cached and then visit the folder above. It seems to reprocess the original images to derive the 4-in-one thumb, rather than using available thumbnails, which accounts for the very long time (a few minutes) it takes to create them.
Confirmed
XnTriq wrote:Additional bug to be reported separately ASAP: Turning off Create high quality thumbnail doesn't work for 4-in-1 thumbs (Show 4 thumbnails in folder's thumbnail (instead of 1)).

Post Reply