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

Olaf Meeuwissen paddy-hack at member.fsf.org
Mon Feb 20 12:52:27 UTC 2017

Hi Vopros,

I haven't looked at GIMP plugin code for like a decade but ...

Vopros writes:

>> 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.

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

More information about the sane-devel mailing list