Gamma adjustment: during scanning or as postprocessing?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Gamma adjustment: during scanning or as postprocessing?
When a document is scanned without any adjustments (brightness and contrast at default level, no gamma adjustments) white paper usually turns into light grey.
For electronic document management this is often undesired. Paper should be true white, text true black. Although the black level is not that critical. 85% black looks like black anyway.
Now the questions is where to perform the adjustments so paper becomes white. Note the I don't want to convert the image to monochrome or grayscale. Logos and signatures should remain colored and recognizable.
One option is to set the brightness, contrast and gamma in the scanner. The advantage is that no information is lost while the image is being adjusted. Inside the scanner, the values have the full resolution of the scanner's image system. What is it, 12 bit or so?
The second option is to scan all linear, and to perform these adjustments in post-processing. Disadvantage is that information might have been lost in the scanner while reducing the image to 8-bit RGB colors. Advantage is that photographs and logos can be masked and excluded from the gamma and contrast adjustments.
I recommend doing gamma adjustment during scanning AND post-processing images as needed.
For just text, adjustment during scanning should be all that is needed. For images, post-processing may be needed.
Using xsane, I usually do a preview scan that automatically adjusts many of the values, plus I can correct them if needed before scanning in high resolution.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Original Poster
Rep:
XSane's gamma correction is amazing.
However I use command line scanning 95% of the time. Slap a sheet under the scanner cover, start a shell script and end up with the PDF. Speed is important.
The script currently includes a gamma table which is sent to the scanner. For B/W copies it is near to perfect.
For some originals like faded thermal paper and photgraphs I can set the --nogamma option.
Another disadvantage of sending the gamma table is that many scanners need completely different gamma tables. Not just a different curve, but also different values (like 0..255 or 0..4095) or 3 RGB tables instead of one.
But I am wondering whether I am throwing away a lot of information when I don't set a gamma correction in the scanner, and the scanner converts the internal bit depth to 8 bit output.
Yes, the scanner does throw away some data if you don't set the gamma properly. I guess in your situation you should have custom gamma tables saved and passed in for different scan types.
Quality is more important for me, so I always use the GUI frontend and tweak the settings to get a good scan. Then I can enhance it further myself if needed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.