[sane-devel] PIXMA: New option gamma

Rolf Bensch rolf at bensch-online.de
Thu Feb 16 19:16:07 UTC 2012

Hello all,

I just committed the new device specific option 'gamma' to git.

gamma can be used as command line parameter e.g. for scanimage.

'--gamma auto' uses '#define AUTO_GAMMA 2.2' from pixma.c.

The range of gamma is between 0.3 and 5.

Xsane overrides the gamma option with a complete gamma table.

custom gamma is enabled for lineart now.


Am 10.02.2012 14:31, schrieb Rolf Bensch:
> Hello all,
> Scanning lineart images with scanimage can be a little bit tricky. If
> the scanner has problems with the default gamma exponents from pixma.c
> or the used subdriver (e.g. pixma_mp810.c)) you should create a gamma
> table with gamm4scanimage and use it with scanimage. This is
> inconvenient if you are searching for the images's best gamma table.
> For normal lineart scans my CS9000F mostly likes a gamma table from the
> gamma exponent of 0.7.
> Inspired from the epjitsu backend I added a new option gamma. Each time
> gamma is used with scanimage the backend generates a new gamma table
> from this gamma exponent.
> With this patch the backend uses default gamma values as follows:
> --custom-gamma=no ==> default gamma from the subdriver
> e.g. default gamma is 0.7 from pixma_mp810.c
> --gamma-table auto ==> default gamma is 2.2 from pixma.c
> --gamma auto ==> default gamma is 0.7
> Please try the attached patch and give me a feedback of your scanner's
> favorite gamma values.
> You can also use xsane to determine the best gamma values of your scanner.
> With your feedback I can decide either to adapt the default gamma
> exponents or to create a new gamma DEVICE parameter for each scanner.
> Xsane is not affected from this patch. After changing some options xsane
> always sends an updated gamma table to the backend.
> Cheers,
> Rolf

More information about the sane-devel mailing list