Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can anyone explian the TWAIN interface?
#1
I've discovered the capability that GIMP has for obtaining images directly from the scanner without creating intermediate files (i.e., File>Create>Scanner/Camera).  What I don't know but think I should is the format of the data be transferred from the scanner to GIMP.  I think the interface that is being used is called TWAIN.  Of course what really matters is the image quality being delivered by this mechanism.  For example, when scanning pictures that I want to edit, in GIMP, I've been avoiding the use of jpeg because of the lossy compression.  I'd opt for tiff if using intermediate files.  Also my scanner is capable of producing images in either 8bit or 16bit formats but when using the TWAIN interface I don't specify a file type.  I've noticed that I can select a 16bit quality on the scanner but I'm pretty sure that what I'm working on in GIMP is only 8bit even though there is never any indication of a format conversion which I think must be happening somewhere.  Is it the scanner or GIMP doing the conversion?  Or else the scanner is able to figure out that GIMP wants 8bit and does it without informing me about the discrepancy.  Is the data being transferred in a format equivalent to a file?  If so what type of file?  Or does the TWAIN specification dictate the format.
Reply
#2
Scan straight into Gimp is file -> Create -> Scanner

Gimp 2.8.x is 24 bit (8 bit x 3 channel) maximum, so even if your scanner produces 48 bit (16 bit x 3 channel) you will only get 24 bit.

This is an ancient Canon LIDE30 scanner in Windows, typical sort of interface, scans directly into Gimp using the Canon TWAIN driver: screenshot http://i.imgur.com/ivG9AsW.jpg

My more usual linux setup, and while this is Gimp 2.9.5 which will handle 48 bit (16 x 3) the scanner driver (SANE) cannot handle that resolution. Still get 24 bit: screenshot http://i.imgur.com/Q4fsBE5.jpg

All you can do is try and see what you get.
Probably scan to a 48 bit tiff and open in Gimp 2.9.5 is your best bet.
For Windows there is a Gimp 2.9.5 at http://www.partha.com

For the rest of your question - data transfer, it will be some type of lossless format, SANE for example, while you can specify a format, defaults to pnm. As important is the ppi used for scanning, 300 for photo quality, increasing the ppi above about 600 is usually a waste of time.
Reply
#3
http://www.eztwain.com/twain1.htm
Reply
#4
(08-23-2017, 06:29 PM)rich2005 Wrote: Gimp 2.8.x is 24 bit (8 bit x 3 channel) maximum, so even if your scanner produces 48 bit (16 bit x 3 channel) you will only get 24 bit.
...
My more usual linux setup, and while this is Gimp 2.9.5 which will handle 48 bit (16 x 3)  the scanner driver (SANE) cannot handle that resolution. Still get 24 bit: screenshot http://i.imgur.com/Q4fsBE5.jpg
...
For the rest of your question - data transfer, it will be some type of lossless format, SANE for example, while you can specify a format, defaults to pnm. As important is the ppi used for scanning, 300 for photo quality, increasing the ppi above about 600 is usually a waste of time.
I am using GIMP 2.8.18.  My reference to 8bit & 16bit pertains to both color & grayscale.  In that for color I also meant 24bit & 48bit.
...
I'll be among the first to try GIMP 2.10 but because of my novice status have resisted the temptation to try a development version.  I suspect that GIMP 2.10 will provide a means for the user to explicitly inquire about this aspect of the image type whereas this isn't necessary for GIMP 2.8 which only does 8bit.
...
If you are correct about lossless that addresses my primary concern but I tend to be curious enough to want to know the specifics.  It is helpful to know that even with GIMP 2.10 this support could be limited to 8bit which should explain why I wanted to know more about how/where any conversion from 16bit to 8bit is done.

(08-23-2017, 07:41 PM)Ofnuts Wrote: http://www.eztwain.com/twain1.htm
Thanks!  This is the kind of information I was seeking.  The part about modes of image transfer somewhat answers my question.  The modes "Native" and "Memory" would have me betting on lossless methods, whereas "File" ought to conform to the specification for the type of file.  Insofar, as the interface I'm using with GIMP provides no awareness of any file creation I'd definitely be expecting "Native" or "Memory".

Since I think GIMP can open a file that uses the 16bit format it does seem that GIMP is capable of converting such to 8bit which still leaves open the question about who does it.  I'm suspecting GIMP because I don't think this is a capability that the source device maker would want to undertake.
Reply


Forum Jump: