Colour count can hang

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, xnview

Post Reply
User avatar
omniplex
Posts: 127
Joined: Thu Feb 10, 2011 1:52 pm
Location: Hamburg
Contact:

Colour count can hang

Post by omniplex »

Counting colours in an image can be hard for cases like the famous ParkJoy 15722.sgi with more than 8 million colours in 3840 x 2160 pixels. That 16bits case doesn't affect 8bits XnView classic. For 8bits the worst case is 2^24 colours in 16million.png mentioned in the online version of the PNG book several times, arranged as 512 x 32768 pixels. Rather ugly, when I open it in XnView 2.34 and (surprised by the odd "fit to window size" effect) try to scroll down XnView crashes: It was already at zoom level 0.02% at this point, maybe it's some unhandled division by zero. :bug:

Doing something else with 16million.png works, but when I click on count colours XnView hangs. Seriously, I can start my very slow pixcount.rex, and when that is ready + minutes later while typing this bug report XnView is still busy and reported as unresponsive in the resource monitor. XnView did not run out of free memory using less than 800 KB. :bug:

The Simpel Filter author created a PhotoShop plugin working also with XnView. The ZIP file with the plugin contains a much nicer 4096 x 4096 test image rgb_gamut.tif, in the same style as the 1000 x 1000 1Mcolors.png on WikiMedia Commons. This plugin can determine the number of colours almost immediately. Out of curiosity, does 8BF indicate 8bits only, or could this also work with 16bits in XnViewMP?

The SF colour count plugin in XnView for 16million.png crashes XnView, it has to be killed with the task manager. :bug:
pixcount 16million.png wrote: 50331648 bytes, RGB in 24 bits
16777216 pixels
16777216 colours (ignoring any transparency)
256 grey (R=G=B in RGB or RGBA)
0 semi-transparent pixels
0 fully transparent counted as black
MD5=9d28a662e7126789b2eb5254f156c9a3
pixcount rgb_gamut.tif wrote: 50331648 bytes, RGB in 24 bits
16777216 pixels
16777216 colours (ignoring any transparency)
256 grey (R=G=B in RGB or RGBA)
0 semi-transparent pixels
0 fully transparent counted as black
MD5=0b6685b615fbcb6b4948774c7785863a
pixcount parkjoy.15722.sgi wrote: 49766400 bytes, RGB in 48 bits
8294400 pixels
8294161 colours (ignoring any transparency)
2 grey (R=G=B in RGB or RGBA)
0 semi-transparent pixels
0 fully transparent counted as black
MD5=17826f21b98bda1ce5f0069f57db1d9d
Post Reply