[sane-devel] 16-bit colour in new GIMP

Vopros vopros4 at inbox.ru
Tue Feb 14 20:38:16 UTC 2017



14.02.2017 17:06, Gene Heskett wrote:
> On Tuesday 14 February 2017 07:32:51 Olaf Meeuwissen wrote:
>> Hi Vopros, Vopros writes:
>>> Hello. Can anybody explain what do I need to do with XSane and
>>> xscanimage to be able to scan in 16-bit directly from GIMP?
>>> xscanimage can scan in 16 bit and save the images, unstable GIMP can
>>> work with them, but it only sees the plugin transferring INT32 data.
>>> How do I make them work together? 
>> The SANE API only provides image data in SANE_Byte buffers. The GIMP
>> SANE plugin code would have to convert that to whatever format the
>> GIMP expects for 16-bit RGB (or grayscale). 
I'm going to try. Hoping someone tells me which documents to read on
GIMP plugins and approximately where to change xscanimage.
>>> Gentoo Linux, AMD64, media-gfx/sane-backends-1.0.25-r1,
>>> media-gfx/sane-frontends-1.0.14, media-gfx/gimp-2.9.4-r2. 
>> FYI, the xscanimage GIMP plugin source bits haven't been touched for
>> over a decade (to cater to gimp-1.2). You may be facing somewhat of
>> an uphill battle there :-( 
> I too have noted that "disparity" in the relatively poor image I get
> when I have the gimp pull an image directly from my Brother
> MFCJ-6920DW, but haven't explored routes around that limitation yet
> other than saving the image from xsane, and reloading it off the hard
> drive. Mainly because my latest ink squirter seems intent on saving
> ink rather than giving me the intense color I crave. But if that gimp
> plugin has bit rotted for a decade, is it not time to raise the issue
> on the gimp list? Given a good, factual description of this problem, I
> can at least make some noise there.

I tried asking in IRC, in #gimp at GimpNet. I was told plugins need
updating.

By the way, is #sane at FreeNode alive? The topic says the latest version
is 1.0.19 and the FAQ link seems long dead.

What do you need from me?More precise description? As much info as possible?

The brief description of the problem is:

16-bit images from XSane plugin are converted to 8-bit. xscanimage
plugin menu item is visible, but disabled.
Gentoo Linux AMD64, media-gfx/sane-backends-1.0.25-r1,
media-gfx/sane-frontends-1.0.14, media-gfx/gimp-2.9.4-r2,
media-gfx/xsane-0.999-r1.


The long description:

I tried it with a flatbed scanner Canon CanoScan LiDE 110, which uses
genesys backend.
1. Started Gimp with
    LC_ALL="C" gimp
2. Started XSane withmenu command
    File > Create > XSane: Device dialog...
Here seems to be an unrelated bug -- XSane did not heed LC_ALL="C" and
used the system default locale for some controls.
3. Opened "Window > Show Standard Options" and set "Bit depth" = 16.
4. In the main XSane window I set options:
    scan mode:"Color"
    source medium: full palette of colors -- this drop-down list used
system language.
    resolution: 100
I kept other options default, i.e. as they were when I first installed
SANE. The option "Reduce 16 bit image to 8 bit" in "Filetype" tab of
"xsane setup" dialog is disabled.
4. Opened "Window > Show Preview", pressed "Acquire preview"-- it
changed settings to:
    gamma: 0.86
    brightness: -4.3
    contrast: 10.4
5. Pressed "Scan" -- this created a new Gimp document titled
"Untitled-1.0 (RGB color 8-bitgamma integer, GIMP built-in sRGB, 1
layer) 848x1178"
Also a messagebox appeared:
  WARNING: Plug-In "xsane"
  (/usr/lib64/gimp/2.0/plug-ins/xsane)
  called deprecated procedure 'gimp-image-add-layer'.
  It should call 'gimp-image-insert-layer' instead!
6. Closed XSane.

I vaguely remember starting xscanimagefrom Gimp a few days ago, but
today the menu item "File > Create > xscanimage > Device dialog..." was
just grayed.Maybe I misremember.


Here is the console output of GIMP after I scanned 2 images with XSane:

$ LC_ALL="C" gimp
This is a development version of GIMP.  Debug messages may appear here.

gimp_display_shell_profile_update
gimp_display_shell_profile_update
gimp_display_shell_profile_update
src_profile: GIMP built-in sRGB
src_format:  R'G'B'A u8
dest_format: R'G'B'A u8
gimp_display_shell_profile_update
src_profile: GIMP built-in sRGB
src_format:  R'G'B'A u8
dest_format: R'G'B'A u8
gimp_display_shell_profile_update
src_profile: GIMP built-in sRGB
src_format:  R'G'B'A u8
dest_format: R'G'B'A u8
gimp_display_shell_profile_update
src_profile: GIMP built-in sRGB
src_format:  R'G'B'A u8
dest_format: R'G'B'A u8


"Help > Plug-In Browser" displays the following descriptions:

xscanimage
<Image>/File/Create/Acquire/xscanimage
Front-end to the SANE interface
Parameters
run-mode INT32 Interactive, non-interactive
Additional Information
This function provides access to scanners and other image acquisition
devices through the SANE (Scanner Access Now Easy) interface.
Author: Andy Beck, Tristan Tarrant, and David Mosberger
Date: 8th June 1997
Copyright: Andy Beck, Tristan Tarrant, and David Mosberger

xsane
GIMP Extension
<Image>/File/Create/Acquire
Front-end to the SANE interface
Parameters
run-mode INT32 Interactive, non-interactive
Additional Information
This function provides access to scanners and other image acquisition
devices through the SANE (Scanner Access Now Easy) interface.
Author: Oliver Rauch
Date: 1998-2013
Copyright: Oliver Rauch





More information about the sane-devel mailing list