Q. I've HP all in one printer / scanner / fax machine installed and I'd love to scan an image using Linux command line or GUI application. How do I scan an image under Linux?
A. SANE (Scanner Access Now Easy) interface API that provides standardized access to any raster image scanner hardware (flatbed scanner, handheld scanner, video- and still-cameras, frame grabbers, etc.). You need to install sane software in order to access device using USB, LPT or network interface. There are various commands for scanning images under Linux:
a] scanimage - It is a command-line interface to control image acquisition devices such as flatbed scanners or cameras.
b] xscanimage / xsane - It provides a graphical user-interface to control an image acquisition device such as a flatbed scanner or a camera. It allows previewing and scanning invidual images and can be invoked either directly from the command-line or through The GIMP image manipulation program.
c] 3rd party Applications: GIMP or OpenOffice.Org and many other Linux application can acquire images using scanner if proper driver is installed.
d] Web interface: Many modern printers and scanners comes with web base tools to scan an image. All you have to do is fire a web browser > Type printer IP address and select Scan option. All scanned images can be viewed and downloaded from browser itself.
Install sane software
scanimage and xscanimage can be installed by typing following command:
$ sudo apt-get install sane sane-utils
- sane-utils: API library for scanners -- utilities
- sane: scanner graphical frontends including GIMP plugin
How do I find out if my scanner detected and driver is installed?
Simply type the following command at a shell prompt to get a list of devices:
$ scanimage -L
device `hpaio:/net/Photosmart_C5100_series?ip=192.168.0.4' is a Hewlett-Packard Photosmart_C5100_series all-in-one device `v4l:/dev/video0' is a Noname Pinnacle PCTV 40i/50i/110i (saa virtual device
How do I scan an image from a shell prompt?
To scan with default settings to the file scan-file.pnm, enter:
$ scanimage >scan-file.pnm
Note: You may need to add sudo command to get privileges to scan an image.
To scan 100x100 mm to the file image.tiff (-x and -y may not be available with all devices):
$ scanimage -x 100 -y 100 --format=tiff >old-photo.tiff
To scan with ADF (Auto Document Feeder), you must use "batch mode":
$ scanimage -b --batch-scan=yes > scanned-file.pnm
xsane: Graphical User Interface
Type xsane at a shell prompt:
Select your scanner and you will see main screen with tons of options:
Set options such as DPI, brightness etc and click on Scan button:
Other software such as GIMP and OpenOffice.org provides an option to scan and import images directly for editing purpose.
Under GIMP visit File > Acquire > XSane > Device Name to scan images.
Under OpenOffice.org wordprocessor visit Insert > Picture > Scan > Request... to scan images.Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop