Discussion:
16-bit colour in new GIMP
(too old to reply)
Vopros
2017-02-13 20:37:52 UTC
Permalink
Raw Message
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?

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.
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Olaf Meeuwissen
2017-02-14 12:32:51 UTC
Permalink
Raw Message
Hi Vopros,
Post by Vopros
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).
Post by Vopros
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 :-(

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Gene Heskett
2017-02-14 14:06:35 UTC
Permalink
Raw Message
Post by Olaf Meeuwissen
Hi Vopros,
Post by Vopros
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).
Post by Vopros
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.
Post by Olaf Meeuwissen
Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since
2004-01-27 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4
A88A F84A 2DD9 Support Free Software
https://my.fsf.org/donate Join the Free Software Foundation
https://my.fsf.org/join
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Vopros
2017-02-14 20:38:16 UTC
Permalink
Raw Message
Post by Gene Heskett
Post by Vopros
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.
Post by Gene Heskett
Post by Vopros
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 #***@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
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Olaf Meeuwissen
2017-02-20 12:52:27 UTC
Permalink
Raw Message
Hi Vopros,

I haven't looked at GIMP plugin code for like a decade but ...
Post by Vopros
Post by Vopros
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.
You may want to look at

- https://developer.gimp.org/api/2.0/libgimp/
- http://gimpbook.com/scripting
- https://docs.gimp.org/

I haven't ;-). These were on the first page of the search engine
results for "gimp plugin documentation".

WRT the code, assuming you are looking at 5e2b3662a of the
sane-frontends code, I *think* lines 819-854, 865-904 and 916-951 in
src/xscanimage.c could use a `case 16:` branch ;-)

I don't know if the newer GIMP APIs require any other changes.

Hope this helps,
--
Olaf Meeuwissen, LPIC-2 FSF Associate Member since 2004-01-27
GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13 F43E B8A4 A88A F84A 2DD9
Support Free Software https://my.fsf.org/donate
Join the Free Software Foundation https://my.fsf.org/join
--
sane-devel mailing list: sane-***@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to sane-devel-***@lists.alioth.debian.org
Loading...