[sane-devel] genesys backend

Pierre Willenbrock pierre at pirsoft.dnsalias.org
Wed Aug 31 21:25:26 UTC 2005


forgot this one:

Stéphane VOLTZ schrieb:
> Le Mercredi 31 Août 2005 14:18, Pierre Willenbrock a écrit :
> 	Hello,
> 	I checked the geneys_low.h that I forgot this morning. 
> 	By the way, are you sure ImageMagick has it wrong with 16 bits pictures ?
> The 16 bits images produced by the backend are displayed fine in 'xsane' and 
> 'display'. Only KDE can't show them correctly. If I take any random pnm file 
> and convert it to 16 bits (with pnmdepth), gimp-2.2 and ImageMagick display 
> them correctly and not KDE.
> 	I haven't been able to find a definitive anwser on the netpbm site. But I 
> think the pnm currently produced are fine.
> Regards,
> 	Stef

According to

the byteorder is big endian:
> A raster of Height rows, in order from top to bottom. Each row
> consists of Width pixels, in order from left to right. Each pixel is a
> triplet of red, green, and blue samples, in that order. Each sample is
> represented in pure binary by either 1 or 2 bytes. If the Maxval is
> less than 256, it is 1 byte. Otherwise, it is 2 bytes. The most
> significant byte is first.

> A row of an image is horizontal. A column is vertical. The pixels in
> the image are square and contiguous.

pnmdepth is not usable for this kind of test. it just duplicates each
byte(at least for maxval=65535). I used the raw data of a scan, which is
always little endian, and the output of scanimage, which is big endian.
The raw data should look like noise when viewed with a correct viewer.
Using xv i the raw data looks okay, and the final image is just noise.

My error was to think the xv program is part of ImageMagick.
ImageMagick is indeed correct. But kde gets it wrong both ways, which is
really interesting. And my gimp-2.2 is completely unable to read binary
encoded 16bit pnm("Invalid maximum value"). It only reads the plain ones.


More information about the sane-devel mailing list