[sane-devel] Scanning with 16 bits color depth (2 bytes/color)

René Rebe rene at exactcode.de
Fri Oct 3 12:02:47 UTC 2008


Hi,

yes, at least some frontends definitely support this, my avision backend
supports 16 bit channels (including upscaling 10 and 12 bit to 16 bit
for devices which support that) for years.

However, I do not remember which frontends worked well, maybe most
worked to some degree, but IIRC the xscanimage preview had issues
receiving 16bit data, but maybe most other frontends worked fine as
I do not have exceptionally bad memory to this topic :-)

Yours,
  René

Nicolas wrote:
> Ok, thanks a lot for this clarification, I understand that 16 bits per
> color images are supported by the standard, so no special scaling would
> be necessary. 
>
> But do you or someone knows if scanimage or Xsane can handle 16 bits per
> color appropriately ?
>
> Nicolas
>
> Le vendredi 03 octobre 2008 à 08:20 +0900, Olaf Meeuwissen a écrit :
>   
>> Nicolas <nicolas.martin at freesurf.fr> writes:
>>
>>     
>>> So my question is: I know Sane standard defines image format to be RGB,
>>> 8 bits/color.
>>>       
>> Not completely correct.  See below.
>>
>>     
>>> But is it possible to request a Sane frontend to get a 16 bits/color
>>> image format and deal with that, or do I have to transform this 48 bits
>>> image format into 24 bits in the backend, before returning the image
>>> data to the frontend ?
>>>       
>> >From the SANE 1.0 API specification, section 3.2:
>>
>>   A SANE image is a rectangular area. The rectangular area is
>>   subdivided into a number of rows and columns. At the intersection of
>>   each row and column is a quadratic pixel. A pixel consists of one or
>>   more sample values. Each sample value represents one channel (e.g.,
>>   the red channel). Each sample value has a certain bit depth. The bit
>>   depth is fixed for the entire image and can be as small as one
>>   bit. Valid bit depths are 1, 8, or 16 bits per sample. If a device's
>>   natural bit depth is something else, it is up to the driver to scale
>>   the sample values appropriately (e.g., a 4 bit sample could be
>>   scaled by a factor of four to represent a sample value of depth 8).
>>
>> So the answer is yes.
>>
>> Hope this helps,
-- 
  René Rebe - ExactCODE GmbH - Europe, Germany, Berlin
  Geschäftsführer: Susanne Klaus, René Rebe
  Sitz: Berlin, Amtsgericht Charlottenburg HRB 105 123 B
  USt-IdNr.: DE251602478
  http://exactcode.de | http://t2-project.org | http://rene.rebe.name




More information about the sane-devel mailing list