Converts ThunderScan .SCAN files to PNG.
ThunderScan was a scanner device for early Macintosh computers that replaced the ribbon cartridge in an Apple ImageWriter printer, turning it into an image scanner. It captured up to 32 levels of gray (5 bits per pixel).
The .SCAN file format stores uncompressed grayscale image data with a split bit-plane layout: 4-bit nibbles plus a 1-bit plane combine to give 5-bit (32-level) grayscale. The format also supports 1-bit halftone images.
The file format was derived with the help of the Photoshop 1.0 source code, which is available for non-commercial use. This was used to document the file format, and that documentation was then used to build a Swift processor.
Note: The
.SCANfile format is not the same as "ThunderScan compression" (TIFF compression code 32809), which is a separate RLE/delta codec for use inside TIFF files.
Requires a Mac with Xcode command-line tools installed.
cd ThunderScanConverter
swift build -c releaseThe binary will be at .build/release/ThunderScanConverter.
# Convert a .SCAN file, writing output alongside the input as .png
.build/release/ThunderScanConverter path/to/image.SCAN
# Specify a custom output path
.build/release/ThunderScanConverter path/to/image.SCAN output.pngSee SCAN_FORMAT.md for complete documentation of the .SCAN file format.
$ .build/release/ThunderScanConverter negs.SCAN
Input: negs.SCAN
Dimensions: 503 x 177
Depth: 5 bits/pixel
Resolution: 100 DPI
Output: negs.png