[sane-devel] Color depth upsampling and compressibility

Gregory C. Johnson lists.ix.sane-devel at gregjohnson.com
Mon Jul 18 12:13:41 UTC 2005

> On Mon, Jul 11, 2005 at 05:11:48PM +0200, Mattias Ellert wrote:
>> Even better would be:
>>               *dst-- = ((*src << 4) & 0xf0) + ((*src)        & 0x0f);
>>               *dst-- = ((*src)      & 0xf0) + ((*src-- >> 4) & 0x0f);
>> Then 0 would map to 0 and 15 to 255, i.e. white is white and black is
>> black.
> You're right. I've changed taht in sp15c.c in CVS.

Some quick Googling doesn't provide dispositive information on this
strategy's impact on compressibility.  However I suspect that introducing
pseudo-random data in the low nybble will reduce compressibility beyond
simply squaring the symbol table.  (Hence, my initial ponderings on
tweaking the constant)

This might be a good candidate for specification in the SANE 2 standard,
as there are clearly multiple strategies for getting from 4 to 8 bits, and
each has different tradeoffs.

Still, I can't imagine this dragon hasn't been slain many times before... 
Anyone know of a dispositive reference that we can just point to?  
Alternately, this should be trivial to explore exhaustively through


More information about the sane-devel mailing list