Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Photocopy software
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Tue Mar 20, 2007 2:44 pm    Post subject: Photocopy software Reply with quote

Hi,

I'm looking for a program with which I can easily scan documents and save them to DjVu files. I use The GIMP (saving as PNG) for it now, but I have to do a lot of manual work, like changing the color levels each time, to avoid white becoming grey (which makes the file big and results in ugly printing of the scan), and I have to scale it down after a 300 DPI scan, because otherwise the file would be too big.

It would be convenient to have a tool which acts like a virtual photocopier, which can save as DjVu, and also support printing. Does anyone know of such a tool?
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Tue Mar 20, 2007 3:31 pm    Post subject: Reply with quote

I'm not familiar with DjVu so I can't help there. I believe VueScan would meet the rest of your needs. It supports auto-white-balancing and tons of advanced features, and saves files in JPEG, raw and several TIFF formats. In particular for copier-style use, it also can create text or multi-page PDF files--it incorporates the best OCR I've used on Linux, bar none. (Caveat: I can't recall if PDF is OCR'ed or saved as images.)

Besides film and photo scanning, I routinely scan documents, receipts and such and archive them as 150-300DPI, 1-bit (B&W) TIFFs. This converts to pure whites and blacks at very compact file sizes. (If you prefer to avoid TIFF you can run them through ImageMagick or GIMP to convert to PNG.) You can save and load configuration profiles for common workflows/tasks, and IIRC you can configure it for one-click scan-(and-save-)and-print operation, to act as a photocopier.

Though it is commercial software, it is reasonably priced and--most importantly--you can try it before you buy. It is actively developed and supported by the author, fully supported on Linux (despite its lack of prominence on the website) and simply an outstanding program.

Since that reads a lot like an advertisement, I'll provide the standard disclaimer that I'm not affiliated with Hamrick in any way, I'm merely a satisfied customer. :D

Edit: I googled DjVu and do recall hearing of (and quite forgetting about) it previously...the UNIX/Linux versions of the DjVu tools appear to include a TIFF converter.
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Tue Mar 20, 2007 5:51 pm    Post subject: Reply with quote

Hmm. I hope the only program for this is not a commercial one. I don't really like commercial programs. Not only because I don't like paying for them, but also because commercial Linux programs often manage to look and feel like they come from the 1970s.

Since you use the program, do you have an e-build for the trial? Another thing I don't like, is installing software on my machine without portage.

BTW The website says it supports more than 700 scanners. What business does a program have with supporting scanners? It merely needs to talk to Sane. Or, is this a symptom of feeling like a 1970s program; of which one flaw is failure to use common libraries...
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
timeBandit
Bodhisattva
Bodhisattva


Joined: 31 Dec 2004
Posts: 2719
Location: here, there or in transit

PostPosted: Tue Mar 20, 2007 8:30 pm    Post subject: Reply with quote

halfgaar wrote:
I don't really like commercial programs. Not only because I don't like paying for them, but also because commercial Linux programs often manage to look and feel like they come from the 1970s.
I fully understand. You might be pleasantly surprised--it's a GTK+-2 application and not unattractive. Notice I didn't say "attractive," but that's only because it's functional not flashy. :D

halfgaar wrote:
Since you use the program, do you have an e-build for the trial? Another thing I don't like, is installing software on my machine without portage.
No, but I'm due for an update anyway so I'll throw one together for you tonight and use the update to test it. I've had this on the to-do list for a while anyway....

halfgaar wrote:
BTW The website says it supports more than 700 scanners. What business does a program have with supporting scanners? It merely needs to talk to Sane. Or, is this a symptom of feeling like a 1970s program; of which one flaw is failure to use common libraries...
At the time I discovered it, VueScan was literally years ahead of SANE in device support and capability (in particular, SANE didn't support my scanner at all). SANE was pretty dreadful for a while, a few years back...maybe that's why the author chose to ignore it. Honestly I don't know.
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Tue Mar 20, 2007 9:18 pm    Post subject: Reply with quote

I gave the trial a short go. I didn't test is thoroughly, but it seems OK. But it being commercial didn't motivate me to test further... If you do make an e-build, don't make it just for me. However, if you make one for yourself however, I would be interested in it.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
FishB8
l33t
l33t


Joined: 17 Mar 2003
Posts: 820

PostPosted: Thu Mar 22, 2007 2:54 am    Post subject: Reply with quote

Why not use Xsane?
_________________
"...as we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously." -Benjamin Franklin
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Thu Mar 22, 2007 10:16 am    Post subject: Reply with quote

That's what I use now, called from The GIMP, and it's clumsy. First you have to scan (at 300 DPI). Then you have to adjust the white balance so that the white background becomes white. Then you have to scale. Then you have to index it to a number of colors. And then you have to save it to a file. For one scan it doesn't really matter, but I need something with which I can do these things automatically, preferably including an archive function as well, because I don't like manual labor.

I would guess Canon (the manufacturer of my scanner) has such software, because the buttons on the scanner ("scan", "copy" and "e-mail") are meant to facilitate just that.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
twstd3bc
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 289
Location: Los Angeles, USA

PostPosted: Wed Jun 06, 2007 11:33 am    Post subject: Reply with quote

halfgaar wrote:
That's what I use now, called from The GIMP, and it's clumsy. First you have to scan (at 300 DPI). Then you have to adjust the white balance so that the white background becomes white. Then you have to scale. Then you have to index it to a number of colors. And then you have to save it to a file. For one scan it doesn't really matter, but I need something with which I can do these things automatically, preferably including an archive function as well, because I don't like manual labor.

I would guess Canon (the manufacturer of my scanner) has such software, because the buttons on the scanner ("scan", "copy" and "e-mail") are meant to facilitate just that.


Here's what I've been doing for the last couple of years. I have an HP 4215 all in one (with ADF), so I

1. Scan with 'scanimage -d --mode Grayscale --resolution 300 -x 8.5in -y 11in --batch=name%02d.pgm'
2. Convert everything to djvu like this: 'for i in name*pgm; do c44 $i; done'
3. Then convert all the pages into one DJVU document with 'djvm -c name.djvu name*djvu'

I've been thinking of putting all of that in a script, but it's so fast, I never bothered. I write anywhere from 2-10 pages of notes everyday, and scan them all at the end of the day. If you want to scan in color, then exclude the '--mode Grayscale' and use ppm instead of pgm for the file extension.
Back to top
View user's profile Send private message
twstd3bc
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 289
Location: Los Angeles, USA

PostPosted: Wed Jun 06, 2007 11:35 am    Post subject: Reply with quote

Oh yeah, c44 and djvm are from the DJVU package, and scanimage is from XSANE.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Wed Jun 06, 2007 11:40 am    Post subject: Reply with quote

What about automatic white balance? When copying something with a photocopier, it usually leaves white as white, but when I scan something, I manually have to change it with the GIMP so that it doesn't have a gray background. It would be nice if it would do it automatically.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
twstd3bc
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 289
Location: Los Angeles, USA

PostPosted: Wed Jun 06, 2007 5:49 pm    Post subject: Reply with quote

halfgaar wrote:
What about automatic white balance? When copying something with a photocopier, it usually leaves white as white, but when I scan something, I manually have to change it with the GIMP so that it doesn't have a gray background. It would be nice if it would do it automatically.


Use 'scamimage --mode Lineart' and save to .pbm instead of .pgm. You may have to increase the dpi for screen viewing depending on your tastes However, at 300 dpi the djvu printout I just did is highly acceptable (which is a pleasant surprise).
Back to top
View user's profile Send private message
twstd3bc
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 289
Location: Los Angeles, USA

PostPosted: Wed Jun 06, 2007 6:00 pm    Post subject: Reply with quote

twstd3bc wrote:
halfgaar wrote:
What about automatic white balance? When copying something with a photocopier, it usually leaves white as white, but when I scan something, I manually have to change it with the GIMP so that it doesn't have a gray background. It would be nice if it would do it automatically.


Use 'scamimage --mode Lineart' and save to .pbm instead of .pgm. You may have to increase the dpi for screen viewing depending on your tastes However, at 300 dpi the djvu printout I just did is highly acceptable (which is a pleasant surprise).


Looks like on my computer, at least, you have to add an extra step. c44 doesn't understand the file generated by scanimage's lineart mode, so one trick I used was convert (from Imagemagick); e.g., 'convert name01.pgm newname01.pgm' gives an acceptable file for c44. Also, you must use .pgm extensions throughout (instead of .pbm) for c44 to understand. The results are identical.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Wed Jun 13, 2007 7:26 pm    Post subject: Reply with quote

OK, I finally put some work in this. I wrote a script to quickly make lineart scans:

Code:
#! /bin/bash
# Author: halfgaar

# Prevent attacker from placing unholy replacements of system commands in your
# working path.
PATH="/usr/bin:/bin:/usr/local/bin"

# User settings
RESOLUTION="400"
SCANNER_DEVICE="plustek"

OUTPUT_FILE_BASENAME=$1
OUTPUT_FILE="$OUTPUT_FILE_BASENAME.djvu"
TEMP_FILE="/tmp/halfgaars_scanned_image"

[ ! -n "$OUTPUT_FILE_BASENAME" ] && echo "No filename given" && exit 1

if [ -e "$TEMP_FILE" ]; then
  echo "Temp file $TEMP_FILE already exists. We don't want to create a symlink vulnerability here..."
  exit 1
fi

if [ -e "$OUTPUT_FILE" ]; then
  echo "$OUTPUT_FILE already exists."
  exit 1
fi

# page dimensions are in mm
scanimage -d $SCANNER_DEVICE -x 210 -y 297 --mode lineart --resolution $RESOLUTION > $TEMP_FILE
cjb2 -dpi $RESOLUTION $TEMP_FILE $OUTPUT_FILE

rm $TEMP_FILE


I used cjb2 instead of c44, as it's meant for lineart graphics. It also removes the necessity to convert a pbm image to pgm, as cjb2 only accepts pbm. And because I don't have a document feeder, there's no need to convert the pages into one doc.

BTW, I demand the world used djvu cbj2 for this, instead of PDF (as most people do), as this is quite cool :)
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
ahubu
Guru
Guru


Joined: 16 Aug 2003
Posts: 400
Location: Groningen, The Netherlands

PostPosted: Sun Jul 01, 2007 2:43 pm    Post subject: Reply with quote

Really interesting, I never heard of djvu before. I'll try this and the script. I had something similar for scanning B/W pages and converting to PDF (as image) . Hopefully this will make the resulting files somewhat smaller. Thanks!
_________________
Anne // Light travels faster than sound. That's why people appear bright until
you hear them speak.
-Unknown
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Sun Jul 01, 2007 3:27 pm    Post subject: Reply with quote

Bare in mind that the scanned image is lineart, not grayscale. I had a quick go at automatic color/grayscale scanning, also saving as djvu, but because of the lack of automatic white balancing, the file was too big. Lineart is good enough for me, for scanning bills and invoices and stuff, so I haven't spent any time trying to improve it.
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
twstd3bc
Apprentice
Apprentice


Joined: 07 Feb 2003
Posts: 289
Location: Los Angeles, USA

PostPosted: Tue Aug 28, 2007 4:37 pm    Post subject: Reply with quote

twstd3bc wrote:
twstd3bc wrote:
halfgaar wrote:
What about automatic white balance? When copying something with a photocopier, it usually leaves white as white, but when I scan something, I manually have to change it with the GIMP so that it doesn't have a gray background. It would be nice if it would do it automatically.


Use 'scamimage --mode Lineart' and save to .pbm instead of .pgm. You may have to increase the dpi for screen viewing depending on your tastes However, at 300 dpi the djvu printout I just did is highly acceptable (which is a pleasant surprise).


Looks like on my computer, at least, you have to add an extra step. c44 doesn't understand the file generated by scanimage's lineart mode, so one trick I used was convert (from Imagemagick); e.g., 'convert name01.pgm newname01.pgm' gives an acceptable file for c44. Also, you must use .pgm extensions throughout (instead of .pbm) for c44 to understand. The results are identical.


I made a mistake above. The extra step isn't needed. C44 doesn't understand PBM, but using CJB2 instead, as Halfgaar notes, works just fine.
Back to top
View user's profile Send private message
halfgaar
l33t
l33t


Joined: 22 Feb 2004
Posts: 781
Location: Netherlands

PostPosted: Tue Aug 28, 2007 9:28 pm    Post subject: Reply with quote

By now, I do have the need for something that scans in greyscale and does proper white balancing, so that the file can be properly compressed. I need to look into that...
_________________
Linux backups the right way.
Get surround sound working.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum