plustek@linuxhacker.org

plustek@linuxhacker.org


Subject: Re: mode changes image size
From: Gerhard Jaeger
Date: Thu, 10 Apr 2003 17:08:28 +0200

On Freitag, 4. April 2003 19:05, Gunther Reiszig wrote:
> Dear friends,
> how does it come that the mode parameter supplied to scanimage changes
> the number of row or columns in the produced image?
>
> # scanimage --mode binary -x 10mm -y 20mm |pnmfile
> stdin: PBM raw, 24 by 39
> # scanimage --mode gray -x 10mm -y 20mm |pnmfile
> stdin: PGM raw, 19 by 39  maxval 255
>
> Gunther
>

Hi Gunther,
 this has something to do with the internal size computing.
10 mm are correctly converted to 118 pixels on a 300dpi base in both cases.
In your example, we use the 50dpi mode and so we have 19 pixels width. This
value will be used in all modes >= 8bit per color. In the other case, we have
binary mode which means 1 bit per pixel, but 19/8 = 2 bytes and 3 bits. The
internal buffers are byte aligned, and so the round-up to 3 is done - result:
3 byte * 8 = 24 and so we have always some inaccuracy when doing scans
in binary mode.

Hope this helps
  Gerhard



plustek@linuxhacker.org