Skip to content

GFerrara/imagewriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

SPDX-License-Identifier: LicenseRef-ImageWriter-NC

ImageWriter

This project converts classic Macintosh ImageWriter printer spool files (generated by the pce/macplus emulator) into bitmap images. It reads the raw serial output (e.g. ser_b.out) and renders normal-quality ImageWriter pages as PNG files.
The following is an example of an image extracted from the famous woodblock MacPaint file.
Woodblock

Licensing

This project is free software for non-commercial use.

Commercial use requires a separate license agreement. See LICENSE and COMMERCIAL_LICENSE.md.

Attribution to the author is required in all cases.
© 2026 - Giorgio Ferrara

ImageWriter interpreter (render_bitmap.py)

render_bitmap.py is the entry point for the ImageWriter interpreter in this repository.

  • It starts by reading an ImageWriter output file (the same format produced by the pce/macplus emulator).
  • It drives normal quality ImageWriter print rendering (not the high-quality ImageWriter mode).
  • The info/ folder contains reference images showing how to configure the emulator to use ImageWriter and how to print from MacWrite and MacPaint

This tool is intended for converting classic 1-bit Macintosh ImageWriter dumps into bitmap output for analysis, preservation, or recreation of printed pages.

Command-line arguments

python render_bitmap.py <input> <output> [options]

  • input: ImageWriter input stream file (binary dump from pce/macplus).
  • output: Output base name (optional extension). A page number is appended automatically, e.g. output_001.png.
  • --page-sep: Separator between output name and page number. Default _ (empty string allowed).
  • --verbose / --no-verbose: Enable/disable logging output. Default --verbose.
  • --paper-format: A4 or USLetter (default: A4).
  • --center-horizontally: Center print horizontally on page.
  • --center-vertically: Center print vertically on page.
  • --margin-left: Left margin in dots (0–100, default 0).
  • --margin-top: Top margin in dots (0–100, default 0).
  • --all-jobs: Consider all print jobs in the stream (default is last job only).

Normal Use Case

The normal use case involves the usage of the pce/macplus emulator:

  1. Run the pce/macplus emulator.

  2. Set the current printer to ImageWriter using the Chooser desk accessory. How to

  3. Open the Mac application you want to print from (e.g., MacWrite or MacPaint).

  4. Print in draft mode (not high quality, as this program doesn't support high-quality ImageWriter mode yet).
    Print dialog in MacWrite: Printing from MacWrite
    Printing in MacPaint 1.5: Printing from MacPaint

  5. After printing finishes, save the emulator file ser_b.out (this corresponds to serial port B attached to the printer).

  6. Run the ImageWriter interpreter to convert that file (print spool containing one or more printed pages) to images:

    python render_bitmap.py ser_b.out output.png

Example

The example/ folder contains a demonstration of the ImageWriter interpreter:

  • ser_b.out: A sample ImageWriter spool file (print output from the famous MacPaint woodblock image).
  • run.sh: A bash script that runs the interpreter with optimal settings for this example.
  • woodblock_001.png: The resulting rendered image.

To run the example:

cd example
./run.sh

This will generate woodblock_001.png from the sample spool file, demonstrating the tool's output.

Multi-page example

The example_2/ folder demonstrates multi-page printing from a complex document:

  • ser_b.out: A sample spool file containing multiple print jobs/pages.
  • run.sh: A bash script that runs the interpreter with --all-jobs to process all pages.
  • out/: Directory containing the generated images (page_001.png through page_005.png).

To run the multi-page example:

cd example_2
./run.sh

This demonstrates processing multiple print jobs and pages, outputting each as a separate PNG file.

About

Converts Apple ImageWriter spool files into bitmap images

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors