Xsane for Gimp - 16bits scans are converted to 8bit

Hello, I noticed this just today. Scanning negatives with the Xsane plugin for Gimp on Linux causes 16bits scans to be downsized to 8bit ones. Using the stand-alone version of Xsane does the job better and delivers 16bit tiffs (if Xsane is instructed to do 16bit scans of course).

I always thought that my (quite old but still good) scanner wasn’t able to do 16bit, but it is Gimp or the Xsane plugin who decides that 8bit is enough!

So do not scan from within Gimp if you want to work with 16bit files.

2 Likes

If your GIMP set up is by default at 8-bit for a new image, that’s normal…

Did you tried to put your preferences to 16bit (Edit/Preferences/Default Image, then on the right at /Precision select 16-bit)?
Then your scanned image should be opened at 16-bit…

1 Like

Hello, thanks for your suggestion, I had not thought to change the precision values for a new image. Unfortunately this doesn’t work, the scanned image is still reduced to 8-bit in Gimp. Also, when I create a new image (Ctrl+N) with 16-bit integer set in Preferences, that new image is still 8-bit. I have to open Advanced options to change the value from 8-bit to 16-bit…

Using Gimp 2.10.18 on Linux, the one from the Software Center provided by Xubuntu. I used Flatpaks and AppImages as well (for newer versions), but they all gave me more or less problems, so I decided to stick to the “official” one.

Um… may be a bug…
I’m on Ubuntu-MATE and it works (up to 32-bit floating point GIMP 2.10.22 from the software center and Appimage from aferrero).

Do you try with that box checked Edit> Preferences> Image Import & Export “Promote imported images to floating point precision”?.

EDIT: Things are getting strange, I did some tests, and now when I import an image I’m only able to open it at 8-bit or 32-bit floating point, I did some changes a while ago (I was opening my images in 16-bit, and don’t want anymore), and it seems I cannot open automatically at 16-bit integer anymore.
I’ll try to find back what I did change few months ago.

I did find something, a bit cumbersome, but it should work. (I still don’t recall what I did months ago in my settings or may be it’s an update)

Anyway, have your setting like my first answer (first screenshot), create a new image (it will be automatically in 16-bit integer) then try to scan your document from that new image you created (import it as new layer), or create a new image by default 8-bit, then convert it to 16-bit (/Image/Precision > 16-bit integer) and import your scan as a new layer.

Then select your new imported layer and Menu >Image > Fit Canvas to layer

Salut Patrice,

Thanks for your help, but things start to get a bit too complicated this way. I cannot “scan from a new 16-bit file” as you suggested, Xsane simply creates a new document in Gimp - and there it is reduced to 8-bit. I know I can paste layers etc., but I want just a 16-bit scan in Gimp!

I solved this by using the stand-alone version of Xsane, scans are 16-bit, I save them and then I open them as 16-bit in Gimp. Much easier!

1 Like

I was looking through the XSane source code this evening (trying to understand how it processes ICC profiles), and I happened to notice that the “export to GIMP” subroutine does always quantize the scans down to 8 bits per channel, regardless of how they were scanned.

Apparently this code hasn’t been updated to reflect GIMP’s relatively new ability to support deeper image types.

So, for now, you are using the only viable method, I think - scan deeper, save, and then import into GIMP. This bypasses the XSane export code path’s limitations.

1 Like

Hello Dave, I looked at the xsane-master code as well (though for other reasons) and it seems that it dates back to May 2013. That’s indeed long before Gimp introduced its 16bit handling of files.