With the release of Acorn 8 last December, I published "ACTN002 Acorn's Native File Format" as part of the documentation updates, which is exactly what it sounds like.
Without going into details (that's what the technote is for), Acorn's file format is a SQLite database, with a simple three-table schema, containing TIFF or PNG bitmaps to represent bitmap layers, and a plist to represent shape layers. Acorn has kept this simple format since version 2.0 back in 2009.
And since the format is a SQLite database, it is incredibly easy for a programmer or anyone else who isn't afraid of Terminal.app to get a composite out of an Acorn file:
echo "select writefile('/tmp/pizza.png', value) from image_attributes where name = 'composite'" | sqlite3 pizza.acorn
That's it. You've now got a PNG copy of the Acorn file "pizza.acorn
" written to /tmp/pizza.png
.
SQLite is bundled with pretty much everything these days, which means you can write some code in Python, Swift, Objective-C, whatever, and easily support reading Acorn files. Here's an incredibly short Python script to do that:
import sqlite3
import sys
conn = sqlite3.connect(sys.argv[1])
cursor = conn.cursor()
cursor.execute("select value from image_attributes where name = 'composite'")
result = cursor.fetchone()
with open(sys.argv[2], "wb") as f:
f.write(result[0])
Note: you should really perform some error checking in actual Python code.
What about in Swift? That's easy too.
This file format has worked well in Acorn for 16 years now, and I plan on keeping it the same moving forward.