Unimplemented Trap
Adventures in hardware and software

Picontosh: The Pi-Icon-Macintosh...

Did you know that Apple’s icon image file format on modern macOS can still store the original 32×32 black and white icons of the original Macintosh operating system? A .icns file can contain everything from these original icons all the way up to the giant full colour 1024x1024 icons for today’s retina displays. The Preview app will still render these 1-bit icons too.

I booted up my Macintosh SE and using ResEdit dug around the system for icons liked and in a few cases—such as the Steve Jobs icon—recreated icons from scratch using the ResEdit icon editor.

A few steps were needed to then get these icons out of classic Mac OS and into modern macOS:

Icon Archiver allowed me to bundle these icons I wanted to keep into a single archive file. Then once I had that file on a modern Mac, used icon_unarchiver from resource_dasm which created individual .icns files that I could then open.

Each of these files contained a single ICN# resource which I had copied out of my system.

Writing a little bit of Python to parse the file format it was a case of looking for the specific series of 4 bytes of the string ICN# that signifies the start of the pixel data. Following that are 128 bytes of pixel data for the icon, and another 128 bytes after that which specifies a mask.

To showcase these icons, I used a small Waveshare LCD connected to a Raspberry Pi Pico running Micropython. When booting this scans the files on the SD card looking for files that match the icons format and contains ICN# data. This builds up a list of pixels that can be drawn on the screen for each icon.

Then simulating the Macintosh desktop it loops randomly through this list and places each icon in a randomly positioned window. Nothing more to it than that: packaged in a 3D printed case, a small desk ornament to showcase the wonderful detail of these 40 year old icons.

The Micropython project is available on GitHub

A small font diversion

So I wanted to show the icons name in each window title, however was missing a key element: the distinctive Chicago font. Surely I thought I could find a suitable pixel font but nothing came close. A few vector versions of Chicago do exist but they weren’t an exact match for the original Chicago when displayed at small sizes. So pixel by pixel I made ChicagoSB.

Blog home