sane-project-website/old-archive/1999-03/0075.html

92 wiersze
4.3 KiB
HTML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!-- received="Mon Mar 8 04:53:28 1999 PST" -->
<!-- sent="Mon, 08 Mar 1999 12:49:55 +0100" -->
<!-- name="=?iso-8859-1?Q?H=E5kan=20Kvarnstr=F6m?=" -->
<!-- email="Hakan.K.Kvarnstrom@telia.se" -->
<!-- subject="Re: Automatic Brightness and Contrast correction?" -->
<!-- id="" -->
<!-- inreplyto="Automatic Brightness and Contrast correction?" -->
<title>sane-devel: Re: Automatic Brightness and Contrast correction?</title>
<h1>Re: Automatic Brightness and Contrast correction?</h1>
<b>=?iso-8859-1?Q?H=E5kan=20Kvarnstr=F6m?=</b> (<a href="mailto:Hakan.K.Kvarnstrom@telia.se"><i>Hakan.K.Kvarnstrom@telia.se</i></a>)<br>
<i>Mon, 08 Mar 1999 12:49:55 +0100</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#75">[ date ]</a><a href="index.html#75">[ thread ]</a><a href="subject.html#75">[ subject ]</a><a href="author.html#75">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0076.html">=?iso-8859-1?Q?H=E5kan=20Kvarnstr=F6m?=: "Re: More problems with Microtek ScanMaker X6"</a>
<li> <b>Previous message:</b> <a href="0074.html">Ingo Wilken: "SANE backend for Siemens ST400 available"</a>
<li> <b>Maybe in reply to:</b> <a href="0047.html">Håkan Kvarnström: "Automatic Brightness and Contrast correction?"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt;Håkan Kvarnström:</i><br>
<i>&gt;&gt; Does any one know how to achieve automated brightness and</i><br>
<i>&gt;&gt; contrast correction for scans made using SANE?</i><br>
<p>
Jiri Baum wrote:<br>
<p>
<i>&gt;Well, ppmnorm / pgmnorm would probably do most of what you're after... They</i><br>
<i>&gt;map the ligthest pixels to white, darkest to black and interpolate (you can</i><br>
<i>&gt;also give it the values manually). Check also pnmgamma, ppmbrighten,</i><br>
<i>&gt;ppmflash and probably some others I've missed.</i><br>
<p>
Yes, the ppm tools can be used as you describe, but the problem is that the<br>
quality of the images will not be optimal. For example if the scanned image<br>
has gamma values between 67 and 136 per bitplane, almost half of contrast<br>
is lost if one let "ppmnorm" recalculate the gamma-values. What I would like<br>
to<br>
to is to look at the gamma-values and try to provide optimal values for both<br>
contrast and brightness such that the resulting scan always have gamma-values<br>
ranging from 0 to 256. In this way, the full color-range of the scanners will<br>
be<br>
used.<br>
This would of course require two scans, although the first could be a fast<br>
preview<br>
scan. In addition, it is not clear to me how one should calculate these<br>
correction values<br>
for brightness and contrast using the first scan. Somehow one must know<br>
whether<br>
the contrast and brightness controls are linear or if the follow some other<br>
function.<br>
<p>
I have been told that GIMP can perform automatic gamma-correction, but<br>
I have not had time to test GIMP yet. Hopefully, GIMP can be scripted so<br>
that I can use it in CGI-scripts.<br>
<p>
/ Håkan<br>
<p>
ness values have linar<br>
<i>&gt;Håkan Kvarnström:</i><br>
<i>&gt;&gt; I have been experimenting with "ppmhist" to create histograms of images</i><br>
<i>&gt;&gt; which I used to calculate correction values for brightness and contrast.</i><br>
<i>&gt;&gt; The problem is that it requires me to scan the same image twice.</i><br>
<p>
Jiri Baum wrote:<br>
<p>
<i>&gt;If you want to set the brightness/contrast directly at the scanner, you'll</i><br>
<i>&gt;naturally have to do two scans; the first one might be just a quick</i><br>
<i>&gt;pre-scan. Even automatic photocopiers do a quick half-scan to set</i><br>
<i>&gt;brightness.</i><br>
<p>
<p>
<p>
<p>
<p>
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0076.html">=?iso-8859-1?Q?H=E5kan=20Kvarnstr=F6m?=: "Re: More problems with Microtek ScanMaker X6"</a>
<li> <b>Previous message:</b> <a href="0074.html">Ingo Wilken: "SANE backend for Siemens ST400 available"</a>
<li> <b>Maybe in reply to:</b> <a href="0047.html">Håkan Kvarnström: "Automatic Brightness and Contrast correction?"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>