AmiCanScan 0.9 - network scanner client for AmigaOS 3.2
=======================================================
AmiCanScan scans over the network from a classic Amiga. The BJNP driver
speaks Canon's own protocol (UDP/TCP port 8612) and serves Canon
multifunction devices such as the PIXMA MX520. The eSCL (AirScan) driver
serves devices with eSCL support. A ReAction window shows a live preview
while a page is being scanned; the command line program AmiCanScanCli
performs the same scans from the Shell and from scripts.
Archive contents
----------------
AmiCanScan.info Workbench drawer icon
AmiCanScan.readme this description
AmiCanScan/
Install-AmiCanScan Installer script (+ icon)
AmiCanScan, AmiCanScan.info the program with its Workbench icon
AmiCanScanCli the command line version
ReadMe this text
LIESMICH the manual in German
LICENSE GNU GPL, version 2 or later
Catalogs/ language catalogs (deutsch, francais,
italiano)
Source/ the source code of the program
Tested hardware
---------------
The tests with a real scanner used one model: the Canon PIXMA MX520.
- Canon BJNP driver: tested with the real MX520 on a real Amiga, from
the flatbed and from the document feeder (ADF). The ADF logic follows
the SANE driver; the real MX520 scanned two A4 sheets into one file.
Automated tests against a simulator of the device cover all modes,
resolutions, paper sizes and the document feeder; every output file is
compared pixel by pixel.
- eSCL driver: tested against a simulator. The MX520 does not support
eSCL, so no real eSCL scanner took part in the tests.
- PDF output (the PDF writer with its JPEG and Group 4 encoders): the
encoders produce the same bytes as Python models, in the emulator and
on a real Amiga (A1200 with PiStorm); the models were checked against
libjpeg and libtiff. On that Amiga the whole program, scanning into
PDF, ran against a simulator of the device (62 cases, every output
file compared pixel by pixel), and poppler opens every PDF without
complaint. With the real MX520 the command line program wrote PDF
files from the flatbed (colour at 75, 150 and 300 dpi, grey at 150
dpi, black and white at 300 dpi) and from the document feeder (two
sheets, one file with two pages); poppler reads all of them, and the
pages show what lay on the glass and in the feeder. The window
(AmiCanScan) wrote a colour page at 600 dpi (A4, 8.6 MB) as PDF with
the real MX520; the file is valid (strict reader, poppler).
- JPEG coding takes CPU time: the PiStorm codes an A4 page at 150 dpi in
colour in about half a second. Classic 68020 and 68030 machines were
not measured; a lower resolution shortens the coding time.
- Other Canon PIXMA devices of the same family may work. Devices of other
brands have not been tested. Reports are welcome (see below).
Disclaimer and support
----------------------
Warranty. This program was developed with the help of artificial
intelligence (AI). The author gives no warranty of any kind, including
warranty of function, freedom from errors and fitness for a particular
purpose. You use the program at your own risk (see also sections 11 and
12 of the GNU General Public License in the file LICENSE).
Support. Please write bug reports as an issue in the GitHub repository
of the project. The author does not answer e-mails about this program.
Features
--------
- ReAction user interface (AmigaOS 3.2) with live preview, and the
command line program AmiCanScanCli with the same scanning code
- Start from the Workbench icon (ToolTypes carry the arguments) or from
the Shell
- Images are written to disk row by row with small buffers, at 600 dpi
A4 as well
- Output: BMP, IFF/ILBM or PDF; 24 bit colour, 8 bit grey or 1 bit black
and white; 75 / 150 / 300 / 600 dpi
- PDF: one file for the whole run; all sheets of the document feeder
become pages of that file. Colour and grey pages are stored as JPEG
(quality adjustable, default 85), black and white pages as lossless
CCITT Group 4. The page size follows the paper size.
- Flatbed or document feeder (ADF; BMP and IFF/ILBM write one file per
sheet, PDF one file for all sheets); paper sizes A4, Letter, A5,
10x15 cm or maximum
- "Find" locates Canon scanners in the local network (BJNP broadcast)
- Menu "Project / About..." shows version and author
- Localised through locale.library: English, Deutsch, Francais, Italiano.
The first language of Prefs/Locale is used automatically; if no
matching catalog exists, the texts are English
Requirements
------------
AmigaOS 3.2 or newer the ReAction classes window.class,
layout.gadget, button.gadget, chooser.gadget,
string.gadget, fuelgauge.gadget, space.gadget
and label.image, plus gadtools.library 39+,
asl.library 37+, graphics.library 40+
TCP/IP stack any stack that provides bsdsocket.library,
for example Roadshow (part of AmigaOS 3.2),
Genesis or Miami. It has to be running
during the scan.
locale.library (optional) for the translations; part of AmigaOS
CPU 68020 or better (the program is compiled for
the 68020)
Memory a few hundred KB of free RAM
A scanner that is switched on and reachable in the same IPv4 network. The
archive contains everything else the program needs.
Installation
------------
Double-click "Install-AmiCanScan" (Commodore's Installer; English,
Deutsch, Francais, Italiano). The Installer suggests SYS:Utilities and
creates the drawer "AmiCanScan" there, or in another drawer of your
choice. It writes the drawer with its icon and the files inside it.
The icon starts SYS:System/Installer with a stack of 32768 bytes. From
the Shell, enter Stack 32768 and then
SYS:System/Installer Install-AmiCanScan
By hand: unpack the archive and copy the drawer to any place. The
language catalogs are found in the drawer's Catalogs/ directory. The
French drawer is called Catalogs/francais (as in the archive) or, with a
c-cedilla (Latin-1 character 231), "fran" + c-cedilla + "ais".
For system-wide use, copy the language drawers to LOCALE:Catalogs/. There
the French drawer is called "fran" + c-cedilla + "ais", because
locale.library knows the language by that name.
Usage
-----
AmiCanScan open the window (double-click the icon)
1. Enter the scanner's address or press "Find".
2. Choose paper feed, page size, resolution, colour depth and the file
format (for PDF also its quality), and the destination file ("..."
opens a file requester).
3. Press "Scan". The live preview fills while the page is read;
"Cancel" stops the scan.
From the Shell:
AmiCanScanCli FIND look for Canon scanners
AmiCanScanCli IP 192.168.1.20 DPI 300 MODE GRAY PAPER A4 FILE RAM:page.bmp
AmiCanScanCli IP 192.168.1.20 SOURCE ADF FORMAT ILBM FILE RAM:doc.iff
AmiCanScanCli IP 192.168.1.20 SOURCE ADF FORMAT PDF FILE RAM:doc.pdf
AmiCanScan IP 192.168.1.20 DPI 150 SCAN QUIT FILE RAM:x.bmp
(scans without interaction)
Arguments (AmigaDOS template):
IP/K,DRIVER/K,DPI/K/N,MODE/K,SOURCE/K,PAPER/K,FORMAT/K,FILE/K,
THRESHOLD/K/N,SCAN/S,QUIT/S,FIND/S,WAIT/K/N,LOG/K,TRACE/S,CANCELAT/K/N,
LANGUAGE/K,QUALITY/K/N
DRIVER = AUTO | BJNP | ESCL MODE = COLOR | GRAY | BW
SOURCE = FLATBED | ADF PAPER = A4 | LETTER | A5 | 10X15 | MAX
FORMAT = BMP | ILBM | PDF LANGUAGE = english | deutsch |
francais | italiano
QUALITY = 0..100: JPEG quality of colour and grey pages in a PDF
(default 85; 0 stores the pages uncompressed: an A4 page at
300 dpi in colour takes 26 MB)
IP may carry a port: 127.0.0.1:8612
LOG=<file> writes a run log (TRACE adds every packet); please attach
the log to a bug report.
A program started from the Workbench (double-click, Directory Opus, ...)
has no command line. It reads the same keys as ToolTypes of the
AmiCanScan icon (Information): IP=192.168.1.20, DRIVER, DPI, MODE,
SOURCE, PAPER, FORMAT, QUALITY, FILE, THRESHOLD, LANGUAGE, LOG, TRACE.
In the shipped icon some entries stand in parentheses; an entry in
parentheses is switched off, and removing the parentheses switches it
on. A switch such as TRACE is on when the entry exists. For a bug
report, enter LOG=RAM:AmiCanScan.log and TRACE. If the machine crashes,
RAM: is cleared; a hard disk path keeps the log in that case.
The last output line of AmiCanScanCli is machine readable and the same
in all languages: "RESULT: OK <file>" (return code 0), "RESULT: ERROR
<text>" (return code 10) or "RESULT: CANCELLED" (return code 5). Return
code 20 means a wrong call. The progress messages before that line
follow the chosen language.
Limitations
-----------
- Tested device: Canon PIXMA MX520 (see above).
- A PDF page contains the scanned image. A text layer (OCR) is not
created. When a run is cancelled or fails, the PDF keeps the pages
that were complete.
- eSCL devices deliver JPEG pages. A PDF takes them over unchanged; with
BMP or IFF/ILBM selected they are saved as delivered, with the
extension .jpg.
- eSCL runs over HTTP (port 80). TLS/HTTPS and the search by mDNS are
not implemented.
- IPv4 only. "Find" sends a UDP broadcast, which stays within the local
network; the address of a scanner behind a router is typed in.
- The scanner has to be switched on. If a device in standby does not
answer, wait a few seconds and try again.
- A TCP connection attempt ends with an error after 8 seconds. When the
device stops answering during a scan, the program reports an error
after 10 to 30 seconds, depending on the step and the driver.
How it works
------------
The Canon protocol (BJNP) wraps Canon's scanner command set in UDP/TCP
packets on port 8612. AmiCanScan implements the session, the command
framing and the scan state machine itself, following the SANE driver
where the device requires it (see Licence and credits). The settings
are negotiated with TWAIN capability names (ICAP_XRESOLUTION, ...) so
that further drivers can be added behind one interface. The protocol
notes are in the comments of src/bjnp.h and src/pixma.c in the Source
drawer.
Source code
-----------
The source code of the program is in the "Source" drawer of this archive
(GNU GPL): the C sources (src/), the Installer script, the catalog
sources (catalogs/*.cd and *.ct; FlexCat builds the .catalog files from
them), the icons (assets/) and the Makefile. Building needs the m68k
cross toolchain (gcc), the clib2 headers and libraries, and the AmigaOS
3.2 NDK; see README.md in the Source drawer. The helper scripts, the
tests and the development notes of the project are in the GitHub
repository of the project.
Licence and credits
-------------------
Copyright (C) 2026 Virtual Dimension, as far as copyright exists in this
work. AmiCanScan was developed with the help of an AI system (Claude by
Anthropic) under the direction of Virtual Dimension, who set the
requirements, made the design decisions, tested the programs and released
them. Whether and how far copyright applies to AI-assisted code is legally
unsettled; where none applies, nothing restricts your use.
AmiCanScan is free software: GNU General Public License, version 2 or (at
your option) any later version - see the file LICENSE.
The knowledge of the Canon protocol comes from the SANE project
(pixma backend and BJNP transport, GPL-2.0-or-later with the SANE
exception; Louis Lagendijk, Wittawat Yamwong and many others) and from
reading the eSCL client of NAPS2 (library NAPS2.Escl, LGPL-2.1-or-later).
The code was written for AmigaOS; where the protocol demands it, its
structure follows those projects (details: NOTICE.md in the Source drawer).
The JPEG encoder follows the algorithms of the Independent JPEG Group's
libjpeg (integer DCT, quality scaling) and of libjpeg-turbo (quantising
with reciprocals); the Group 4 coder follows ITU-T T.6. This software is
based in part on the work of the Independent JPEG Group.
The programs contain parts of clib2, the C library for AmigaOS (Copyright
(c) 2002-2015 Olaf Barthel and contributors, BSD-style licence; the text is
in NOTICE.md in the Source drawer).
Canon, PIXMA and BJNP are names or products of Canon Inc. This project is
not affiliated with or endorsed by Canon.
History
-------
0.9 (04.11.2026) PDF output (FORMAT PDF): one file for a whole document
feeder run; colour and grey pages as JPEG (QUALITY),
black and white lossless as CCITT Group 4; JPEG pages
of eSCL devices taken over unchanged; quality choice
in the window. The program is now called AmiCanScan.
The document feeder is confirmed on a real MX520. The
Installer icon sets the default tool
SYS:System/Installer and a stack of 32768 bytes.
0.8 (29.10.2026) document feeder (ADF): paper status and end of the stack
as in the SANE driver (confirmed on a real MX520 with
0.9); disclaimer and notes on support in this text;
Source drawer limited to the program sources, source
comments in English.
0.5 (14.10.2026) first release: Canon BJNP and eSCL drivers,
ReAction user interface with live preview, command
line tool, ToolTypes for the Workbench start, About
menu, English / Deutsch / Francais / Italiano,
Installer, icons.
|