[sane-devel] grey 4bit/pixel

abel deuring adeuring at gmx.net
Sat Aug 19 12:56:58 UTC 2006

Shashi Kumar M.S. wrote:
> hi, 
> iam searching a scanner that supports at about 300 dpi and 4 bit /pixel grey 
> scanner. i found from the scanner that most of the scanner support 8/16 bit 
> depth in grey mode. 
> is there any way to modify this code to support 4 bit grey scale depth per pixel. 

well, the source code of scanimage, xsane etc is freely available ;)

> all suggestions are welcome 

- look for a (documented) file format that supports 4 bit images (or
  define your own format ;)
- patch scanimage or another frontend so that it can write the scan
  data in the format you selected. Alternatively, you can convert
  existing 8 bit images, as produced by a Sane frontend, with a
  converter program. I am not aware of any 4 bit image formats, but
  if they exist, you might already find such a converter in the
  usual Linux distributions. Otherwise, write one. The PPM, PGM, PBM
  formats (default for scanimage output) are very simple, and it is
  quite straightforward to read them with C, Python, Perl, Java or
  whichever other programming language.


More information about the sane-devel mailing list