Hi David,

David Neary wrote:

I'll conduct some tests some time and try and figure out just how bad these quantisation errors could be.

Great - quantitative data will really help.

I've done some testing - I wrote a little program that puts every possible 8-bit RGB colour through an lcms transform. A frequency table is kept of every colour that comes out the other side, which gives us some idea of how many codes are "lost" - how badly the dynamic range is reduced.


First, as a control subject, I analyzed the gamma function at 1.1 and 0.6. The results are as follows:

Gamma 1.1
Code use tally:
00: 1707993
01: 13481272
02: 1529388
03: 0
04: 57834
05: 0
06: 0
07: 0
08: 729
09: 0

In other words, 13,481,272 colours are mapped with a 1:1 ratio, so can be transformed back again without loss. 1,707,993 colours are missing from the destination set, and just under 1,600,000 colours are arrived at from multiple source colours.

Gamma 0.6
Code use tally:
00: 7647887
01: 4251528
02: 3700404
03: 0
04: 1073574
05: 0
06: 0
07: 0
08: 103823
09: 0

Gamma 0.6 is considerably more destructive, only 1/4 of the codes maintain a 1:1 mapping.

Now for AdobeRGB <-> sRGB:

sRGB -> AdobeRGB1988
Code use tally:
00: 8102616
01: 4172676
02: 3175714
03: 438068
04: 538838
05: 66267
06: 124002
07: 23117
08: 48831
09: 87087


AdobeRGB1988 -> sRGB Code use tally: 00: 8012181 01: 8325155 02: 156167 03: 54498 04: 10468 05: 58725 06: 15054 07: 2108 08: 2129 09: 140731

This isn't as bad as I'd feared, but still considerably worse than either of the gamma tests.

In both cases nearly half the codes in 8-bit RGB space are lost!

This in effect reduced 24-bit RGB to 23-bit RGB. As I said, this isn't as bad as I'd feared - I was expecting to see a loss of nearly 1-bit per channel; in fact we lose only approximately 1-bit over the whole image.

If anyone's curious enough to want the source of my test program, just ask :)

All the best,
--
Alastair M. Robinson
_______________________________________________
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer

Reply via email to