Re: [sane-devel] HP Scanjet 3670 bad colors

2014-06-02 Thread Stef

On 27/05/2014 18:13, Octavio Alvarez wrote:

On 05/24/2014 08:25 AM, Octavio Alvarez wrote:

On 05/23/2014 10:58 PM, Stef wrote:

 target_code is giving the desired target value for white. Once this
value is correct : not too low, and not too high to avoid
solarization, you should turn to tuning gamma values. They are defined
in genesys_devices.c for the CCD_HP3670. Currently it is 1.0 for each
color channels, and this need to be adjusted. This will improve the
histogram.

For some reason I haven't been able to find out yet, changing gamma
values on genesys_devices.c:350 doesn't seem to change anything, no
matter if I set them to 1.5, 2, 3, 10 or 0.5, 0.2, etc.

Changing target_code makes a difference (just to make sure my
compilation environment is correct).

Hello again.

Considering I wasn't able to play with gamma values in code, I took
sample scan images with a calibration sheet for all combinations of:

target_code = { 0x, 0x1000, 0x2000, ..., 0xe000, 0xf000 } in
descending order
resolution = { 75, 100, 150, 300 }

I uploaded the images to the following URL:

http://blog.alvarezp.org/files/scan-hp3670/calibration/

The 300 dpi scans are bigger, of course, but I found different scan
results for different dpi. I wonder if this is just a cheap scanner.

Anyway, I find 0x4000 to have the best value to have no solarization but
the higher the dpi, the darker the images.

While trying to fix the images in Gimp with the Levels and Curves tool I
find that green is more sensible to low light so its 0 point should be
moved to about 15/255 to prevent the shadows to come out greenish. Also
it needs a gamma of about 1.20 to balance the midtones out.

Blue needs a gamma of about 0.80. Red is ok.

Hope this helps.

Hello,

many thanks for your work. Once I fixed an intermittent issue in 
LiDE 210 head parking, I'll use all these information to improve HP3670 
color scan quality.


Regards,
Stef

--
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] HP Scanjet 3670 bad colors

2014-05-27 Thread Octavio Alvarez
On 05/24/2014 08:25 AM, Octavio Alvarez wrote:
 On 05/23/2014 10:58 PM, Stef wrote:
 target_code is giving the desired target value for white. Once this
 value is correct : not too low, and not too high to avoid
 solarization, you should turn to tuning gamma values. They are defined
 in genesys_devices.c for the CCD_HP3670. Currently it is 1.0 for each
 color channels, and this need to be adjusted. This will improve the
 histogram.
 
 For some reason I haven't been able to find out yet, changing gamma
 values on genesys_devices.c:350 doesn't seem to change anything, no
 matter if I set them to 1.5, 2, 3, 10 or 0.5, 0.2, etc.
 
 Changing target_code makes a difference (just to make sure my
 compilation environment is correct).

Hello again.

Considering I wasn't able to play with gamma values in code, I took
sample scan images with a calibration sheet for all combinations of:

target_code = { 0x, 0x1000, 0x2000, ..., 0xe000, 0xf000 } in
descending order
resolution = { 75, 100, 150, 300 }

I uploaded the images to the following URL:

http://blog.alvarezp.org/files/scan-hp3670/calibration/

The 300 dpi scans are bigger, of course, but I found different scan
results for different dpi. I wonder if this is just a cheap scanner.

Anyway, I find 0x4000 to have the best value to have no solarization but
the higher the dpi, the darker the images.

While trying to fix the images in Gimp with the Levels and Curves tool I
find that green is more sensible to low light so its 0 point should be
moved to about 15/255 to prevent the shadows to come out greenish. Also
it needs a gamma of about 1.20 to balance the midtones out.

Blue needs a gamma of about 0.80. Red is ok.

Hope this helps.

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] HP Scanjet 3670 bad colors

2014-05-24 Thread Octavio Alvarez
On 05/23/2014 10:58 PM, Stef wrote:
 target_code is giving the desired target value for white. Once this
 value is correct : not too low, and not too high to avoid
 solarization, you should turn to tuning gamma values. They are defined
 in genesys_devices.c for the CCD_HP3670. Currently it is 1.0 for each
 color channels, and this need to be adjusted. This will improve the
 histogram.

For some reason I haven't been able to find out yet, changing gamma
values on genesys_devices.c:350 doesn't seem to change anything, no
matter if I set them to 1.5, 2, 3, 10 or 0.5, 0.2, etc.

Changing target_code makes a difference (just to make sure my
compilation environment is correct).

Best regards.


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] HP Scanjet 3670 bad colors

2014-05-23 Thread Stef

On 20/05/2014 18:42, Octavio Alvarez wrote:

On 05/20/2014 12:27 AM, Octavio Alvarez wrote:

So far, I have repeated some of the tests with scanimage only and
target_code seems to be too high for my taste. 0x8000 seems like a lot
better value. I'm still testing though.

Hi, Stef. I have made some tests using scanimage only. I, effectively,
don't get the artifacts anymore. Thanks a lot! However, you were right,
the image quality has problems.

Using target_code = 0xe000, the currently coded value, I get a bluish
and saturated image. I tried lowering target_code across multiple values
down to 0x4000. The lower the value, the better the quality but the
darker the image.

At 0xb000, the horizontal extremes of the image are white balanced but
it is still noticeably bluish towards the center. This is, two small
vertical correctly white-balanced sections are noticed at the left and
right extremes.

For example, at 0x8000, the image is not saturated anymore, and the
image is way better white-balanced overall. However, the image is
noticeably darker image (75% of the histogram with typical white at 55%
luminosity). There is still a noticeably vertical stripe towards the
blue, a bit off the center towards the right.

At 0x4000, I don't get bluish stripes and perfect white-balance, but it
results in only half of the histogram.

I tried tweaking the o value (offset?) but I didn't seem to find any
kind of pattern, except that if I set it too high I get badly colored
stripes, so I just left them at their original values.

Thanks again.

Hello,

the offset shouldn't be touched. For some undocumented reason the 
ASIC needs it to have the shading coefficients match the right pixels.


target_code is giving the desired target value for white. Once this 
value is correct : not too low, and not too high to avoid 
solarization, you should turn to tuning gamma values. They are defined 
in genesys_devices.c for the CCD_HP3670. Currently it is 1.0 for each 
color channels, and this need to be adjusted. This will improve the 
histogram.


Regards,
Stef

--
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] HP Scanjet 3670 bad colors

2014-05-20 Thread Stef
Hello, 

Could you run a preview with debug traces enabled like you already done? Since 
the fix works great here, I'd like to check what is going wrong.

Regards,
Stef

Octavio Alvarez alvar...@alvarezp.ods.org a écrit :

On 05/12/2014 09:40 PM, Stef wrote:
 On 05/04/2014 03:10, Octavio Alvarez wrote:
 On 03/04/14 12:20, Stef wrote:
 On 01/04/2014 05:42, Octavio Alvarez wrote:
 On 03/31/2014 08:37 PM, Stef wrote:
   thanks for all the data. It'll take me a couple of days to
 analyze
 them and compare with the results of my hp3670.
 If you also have one and works then we may have different versions of
 the 3670. Mine has regulatory model GRLYB-0306.

  Hello,

  I have reproduced the bug with my scanner. The calibration needs to
 be tuned or reworked. I'll have a fixed version in a few days.
 Great to know! Thanks in advance.

 Octavio.

 Hello,
 
 I have just pushed the fix in git. However I have some doubt about
 scan quality. And I'm afraid that my HP3670 is failing. Please let me
 know if scan quality is OK.

Hi, Stef.

I appreciate you working on this. I just tested the latest commit. I'm
sorry to say that changes in genesys files sources did not improve scan
results. Color is still incorrect in the same way as before.

I made sure I used the most recent commit isolated from the install from
my system. I used xscanimage under ~/sane-install/bin.

[Mon May 19 21:38:31 -0700 -- alvarezp@laptop:~/sane-install]
$ ls -l $(find -iname '*genesys*')
-rw-r--r-- 1 alvarezp alvarezp1937 Mar 30 15:03
./etc/sane.d/genesys.conf
-rwxr-xr-x 1 alvarezp alvarezp 991 May 19 21:31
./lib/sane/libsane-genesys.la
lrwxrwxrwx 1 alvarezp alvarezp  25 May 19 21:31
./lib/sane/libsane-genesys.so - libsane-genesys.so.1.0.25
lrwxrwxrwx 1 alvarezp alvarezp  25 May 19 21:31
./lib/sane/libsane-genesys.so.1 - libsane-genesys.so.1.0.25
-rwxr-xr-x 1 alvarezp alvarezp 1123367 Mar 30 21:13
./lib/sane/libsane-genesys.so.1.0.23
-rwxr-xr-x 1 alvarezp alvarezp 1325444 May 19 21:31
./lib/sane/libsane-genesys.so.1.0.25
-rw-r--r-- 1 alvarezp alvarezp   10854 May 19 21:31
./share/man/man5/sane-genesys.5

[Mon May 19 21:38:35 -0700 -- alvarezp@laptop:~/sane-install]
$ cd ../src/sane/sane-backends/

[Mon May 19 21:39:33 -0700 -- alvarezp@laptop:~/src/sane/sane-backends
(master)]
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

[Mon May 19 21:40:18 -0700 -- alvarezp@laptop:~/src/sane/sane-backends
(master)]
$ git log HEAD^..HEAD
commit 18de732bbf80e35ad9247f5668da84e14e76fa8e
Author: Rolf Bensch roben-gu...@alioth.debian.org
Date:   Fri May 16 15:41:18 2014 +0200

changelog for recent work


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org

Re: [sane-devel] HP Scanjet 3670 bad colors

2014-05-20 Thread Octavio Alvarez
On 05/19/2014 09:51 PM, Octavio Alvarez wrote:
 I made sure I used the most recent commit isolated from the install from
 my system. I used xscanimage under ~/sane-install/bin.
 

I'd like to correct myself.

Please take my previous message with a grain of salt (or disregard it
altogether). I'm noticing that xscanimage is behaving differently than
scanimage, regardless of whether I recompile both sane-backends and
sane-frontends or just sane-backends.

I noticed this because xscanimage is not affected when target_code is
changed (and after a make  make install), but scanimage is. I need to
find some ground on this. Apparently scanimage *is* regenerated when
sane-backends are recompiled.

So far, I have repeated some of the tests with scanimage only and
target_code seems to be too high for my taste. 0x8000 seems like a lot
better value. I'm still testing though.

Thanks.


-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] HP Scanjet 3670 bad colors

2014-05-20 Thread Octavio Alvarez
On 05/20/2014 12:27 AM, Octavio Alvarez wrote:
 So far, I have repeated some of the tests with scanimage only and
 target_code seems to be too high for my taste. 0x8000 seems like a lot
 better value. I'm still testing though.

Hi, Stef. I have made some tests using scanimage only. I, effectively,
don't get the artifacts anymore. Thanks a lot! However, you were right,
the image quality has problems.

Using target_code = 0xe000, the currently coded value, I get a bluish
and saturated image. I tried lowering target_code across multiple values
down to 0x4000. The lower the value, the better the quality but the
darker the image.

At 0xb000, the horizontal extremes of the image are white balanced but
it is still noticeably bluish towards the center. This is, two small
vertical correctly white-balanced sections are noticed at the left and
right extremes.

For example, at 0x8000, the image is not saturated anymore, and the
image is way better white-balanced overall. However, the image is
noticeably darker image (75% of the histogram with typical white at 55%
luminosity). There is still a noticeably vertical stripe towards the
blue, a bit off the center towards the right.

At 0x4000, I don't get bluish stripes and perfect white-balance, but it
results in only half of the histogram.

I tried tweaking the o value (offset?) but I didn't seem to find any
kind of pattern, except that if I set it too high I get badly colored
stripes, so I just left them at their original values.

Thanks again.

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
 to sane-devel-requ...@lists.alioth.debian.org


Re: [sane-devel] HP Scanjet 3670 bad colors

2014-05-12 Thread Stef

On 05/04/2014 03:10, Octavio Alvarez wrote:

On 03/04/14 12:20, Stef wrote:

On 01/04/2014 05:42, Octavio Alvarez wrote:

On 03/31/2014 08:37 PM, Stef wrote:

  thanks for all the data. It'll take me a couple of days to analyze
them and compare with the results of my hp3670.

If you also have one and works then we may have different versions of
the 3670. Mine has regulatory model GRLYB-0306.


 Hello,

 I have reproduced the bug with my scanner. The calibration needs to
be tuned or reworked. I'll have a fixed version in a few days.

Great to know! Thanks in advance.

Octavio.


Hello,

I have just pushed the fix in git. However I have some doubt about 
scan quality. And I'm afraid that my HP3670 is failing. Please let me 
know if scan quality is OK.


Regards,
Stef

--
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject unsubscribe your_password
to sane-devel-requ...@lists.alioth.debian.org