UInk Specification
About 616 words
UInk is an open file format for digital ink. A single .uink file can hold an entire whiteboard, or all the annotations on a whole PowerPoint deck: multiple pages, multiple screens, strokes, shapes, images and PDFs. Different annotation and whiteboard apps read and write it by the same rules, so when you open it in another app, every stroke is right where it was.
UInk 1.1
The current version is Header.version = 11. For the changes from 1.0 to 1.1, see Versions and Changes.
Two key features
Universal
UInk divides its features into five levels. Implementing only the most basic level, Core (multiple pages, strokes and basic shapes), is enough to display the main content of any UInk file correctly; higher levels also preserve highlighters, dashed lines, images, PowerPoint binding and more. When an app meets content it does not support, there is a defined fallback, so the file still opens.
→ Levels and Certification · Compatibility and Fallback
All in one
All the pages of a whiteboard, and the annotations on every slide of a PowerPoint deck, live in the same .uink file. A file can contain several scenarios at once (screen annotation, whiteboard, PowerPoint), several screens and several layers; when you turn a whiteboard page or move to another slide, only the changed page needs to be appended to the end of the file.
→ Main Ink File · Saving, Appending and Recovery
Files
lesson.uink main file: MessagePack object stream
lesson.uink.extra resource package: ZIP, optional
images
diagram.png
documents
handout.pdf
- The main file
filename.uinkis a sequence of MessagePack objects that stores every page, stroke, shape and media reference. It is always the authoritative source of the content. - The resource package
filename.uink.extrais a ZIP that stores images, PDFs, audio, video and other resources. It may be absent. When resources are missing, strokes and shapes are displayed as usual.
Structure at a glance
- Header
Type 0Identity and version - Header Extension
Type 1Screens, workspaces · optional - Canvas
Type 2Page 1 - Ink
Type 3 - Shape
Type 5 - Media
Type 4
- Canvas
- Canvas
Type 2Page 2 - Ink
Type 3 - Clear
Type 6 - Ink
Type 3
- Canvas
- …
- End of fileEOF
| Block | Purpose |
|---|---|
| Header | Start of the file: identity and version |
| Header Extension | Registers screens (Device) and scenarios (Workspace); optional |
| Canvas | One page (one layer on one screen), plus page number, background, PowerPoint binding, pan and zoom |
| Ink | One stroke: normal pen, highlighter, eraser |
| Shape | One shape: line, rectangle, circle, polygon; complex shapes are made of several parts |
| Media | One image, one PDF page, one audio or video clip |
| Clear | One clear that can be undone |
Design trade-offs
- Content and layout match, pixels may not. Stroke curve interpolation, anti-aliasing and arrowhead shapes may differ between apps; point positions, widths, colors and order must match.
- Fast saving, safe against crashes. While writing, an app can append to the end of the file every time the pen is lifted; if the app crashes, at most the last unfinished object is lost.
- Redo is not saved. The file stores the current content and undo groups; the undo granularity is up to the app.
- Unknown content can be skipped. Older apps skip the blocks and fields added by newer versions and display the rest as usual.
Where to start
| You want to | Read |
|---|---|
| Write a minimal reader that can display UInk first | Quick Start |
| Decide which level to implement | Levels and Certification |
| Check the rules one by one | The numbered rules on each block page, and Conformance and Samples |
| Have an AI assistant help you implement | Single-file spec(Open in new window) (in Chinese), llms.txt(Open in new window) |
| Look up what a term means | Glossary |