Das Werkstatt

what we do? everything.
It is currently Fri Sep 10, 2010 4:20 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: HP OfficeJet 6310: Disable JPEG compression for scanning
PostPosted: Thu Apr 02, 2009 12:57 pm 
Offline
Site Admin
User avatar

Joined: Fri Aug 29, 2003 6:39 pm
Posts: 763
I was pretty amazed when the KDE printer handling automagically detected my OfficeJet connected over ethernet - and it was ready for printing. wow!

But not only printing. I was even more astonished when I started Kooka and it listed the the OfficeJet as network scanner. how cool is that?

Well, unfortunately HP seems to have JPEG compression enabled by default. yuck.
I haven't found a way to access advanced settings of the SANE scanner backend through Kooka or XSane, but the good old commandline tool "scanimage" comes to the rescue!

First: find your scanner:
Code:
scanimage --list-devices

This will return all scanners found attached to your system. In my case it looked like this:
Quote:
device `hpaio:/net/Officejet_6300_series?ip=192.168.x.x' is a Hewlett-Packard Officejet_6300_series all-in-one

Then get a list of advanced settings for your model:
Quote:
scanimage -d hpaio:/net/Officejet_6300_series?ip=192.168.x.x --help

Which, for the OfficeJet looks like this:
Quote:
Options specific to device `hpaio:/net/Officejet_6300_series?ip=192.168.1.51':
Scan mode:
--mode Lineart|Gray|Color [Color]
Selects the scan mode (e.g., lineart, monochrome, or color).
--resolution 75..600dpi [75]
Sets the resolution of the scanned image.
Advanced:
--contrast 0..100 [inactive]
Controls the contrast of the acquired image.
--compression None|JPEG [JPEG]
Selects the scanner compression method for faster scans, possibly at
the expense of image quality.
--jpeg-quality 0..100 [10]
Sets the scanner JPEG compression factor. Larger numbers mean better
compression, and smaller numbers mean better image quality.
--batch-scan[=(yes|no)] [no]
Enables continuous scanning with automatic document feeder (ADF).
--source Auto|Flatbed|ADF [Auto]
Selects the scan source (such as a document-feeder).
Geometry:
--length-measurement Unknown|Approximate|Padded [Padded]
Selects how the scanned image length is measured and reported, which
is impossible to know in advance for scrollfed scans.
-l 0..215.9mm [0]
Top-left x position of scan area.
-t 0..381mm [0]
Top-left y position of scan area.
-x 0..215.9mm [215.9]
Width of scan-area.
-y 0..381mm [381]
Height of scan-area.


Great! There's a line for setting the compression:
Quote:
--compression None|JPEG [JPEG]

As you can see, the default is "JPEG". :(

Now you can scan it as a 300dpi, uncompressed TIFF image like this:
Code:
scanimage -d hpaio:/net/Officejet_6300_series?ip=192.168.x.x --compression=None --format=tiff --resolution=300 > imagefile.tiff


That did the trick for disabling the ugly JPEG compression artifacts, but I've got strange interlaced-looking stripes in the scan. Haven't figured out where they come from, but that's another issue.

_________________
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!


Top
 Profile  
 
 Post subject: 6310 scanning - update
PostPosted: Wed Oct 07, 2009 1:44 pm 
Offline
Site Admin
User avatar

Joined: Fri Aug 29, 2003 6:39 pm
Posts: 763
Today I've played with the scanning quality again. Here are my updates:

1) There are no interlacing or whatever graphical artifacts anymore. Image quality is fine, and way better than using default settings (e.g. web-interface of the 6310).

It seems that the interlacing-style artifact came from choosing a non-straight resolution (e.g 250dpi instead of 300). I've

2) It's possible to scan a JPEG, but reduce the compression:
Code:
scanimage --jpeg-quality=0 --resolution=300 -d hpaio:/net/Officejet_6300_series?ip=192.168.x.x > imagefile.jpg 


3) I've made a quick comparison HTML page again:
http://in.das-werkstatt.com/rooker/contribs/hp6310/
The devil's in the detail. If you download the displayed .png images of the scans and zoom in, you'll see what the benefit of uncompressed scans is.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group