This page follows the OpenRaster specification, version 0.0.6: the baseline file layout, the layer stack, and the two published extensions. An OpenRaster file is a zip archive of PNG images and one XML file that says how to stack them.
Archive rules
- A zip archive with the extension
.ora. Entries may only be stored or deflated; no other compression method is allowed. - Entry names are case-sensitive and UTF-8. Non-ASCII names need the zip UTF-8 flag, or readers may take them as code page 437.
- Zip64 must be used for archives over 4 GB.
- The only ordering rule is that
mimetypeis the first entry.
Entries
| Entry | Required | Contents |
|---|---|---|
mimetype | yes | Exactly image/openraster, with no spaces or newline. The first entry, stored uncompressed, so the type can be read without unzipping: with no extra field in the zip header, the text starts at byte 38 of the file. |
stack.xml | yes | The layer stack, UTF-8 XML, described below. |
Thumbnails/thumbnail.png | yes | A non-interlaced PNG, 8 bits per channel, no larger than 256 by 256 pixels: as large as possible within that without enlarging the image or changing its aspect ratio. No frame or decoration. Never referenced from XML. |
mergedimage.png | yes, since 0.0.2 | The final, flattened image as a PNG of 8 or 16 bits per channel, with no frame or decoration. Optional before version 0.0.2. |
data/… | no | The usual place for layer images and other data. Each file is referenced from stack.xml by its full path from the root of the archive, such as data/layer2.png, and every file there should be referenced. Common extensions such as .png are written in lower case. |
stack.xml
<?xml version="1.0" encoding="UTF-8"?>
<image version="0.0.6" w="1024" h="768" xres="300" yres="300">
<stack>
<layer name="Ink" src="data/ink.png" composite-op="svg:multiply"/>
<stack name="Colours" opacity="0.8" isolation="auto">
<layer name="Shading" src="data/shade.png" x="40" y="12"/>
<layer name="Flats" src="data/flats.png" visibility="hidden"/>
</stack>
<layer name="Paper" src="data/paper.png"/>
</stack>
</image>
Elements
| Element | Contains | Attributes |
|---|---|---|
image | One stack, the root stack. | w, h and version required; xres and yres optional. |
stack | stack, layer and text children, uppermost first. | On a nested stack: name, opacity, visibility, composite-op, isolation. The root stack has none of them. |
layer | Nothing. | src required; name, x, y, opacity, visibility, composite-op, and the extension attributes selected and edit-locked. |
text | Allowed as a child of stack, but not defined by the baseline. |
Attributes
| Attribute | On | Value | Default | Meaning |
|---|---|---|---|---|
w, h | image | positive integer | required | Width and height of the image. Layers may extend past it; the picture is cropped to it for display and export. |
version | image | Semantic Versioning 2.0.0 string | required | Version of the specification the file follows, such as 0.0.6. Added in 0.0.1. |
xres, yres | image | integer, at least 1 | 72 | Resolution in pixels per inch. Both or neither. Added in 0.0.3. |
name | stack, layer | text | none | Name shown to the user. |
src | layer | path | required | Path of the layer’s image inside the archive. |
x, y | layer | signed integer | 0 | Position of the layer’s top-left corner in pixels from the image’s top-left corner. Stacks add no offset of their own; since 0.0.6 x and y are no longer allowed on stacks. |
opacity | stack, layer | 0.0 to 1.0 | 1.0 | Multiplied with the alpha channel before blending. |
visibility | stack, layer | visible or hidden | visible | Whether it is drawn. |
composite-op | stack, layer | operator, below | svg:src-over | How it is combined with what is below. On a stack it matters only when the stack is isolated. |
isolation | stack | isolate or auto | isolate | isolate renders the stack on its own transparent backdrop and then composites the result; auto composites its layers straight onto what is below. Added in 0.0.4. |
selected | layer | true or false | false | Extension (layer selection status): the user had the layer selected, and it may be made active after loading. |
edit-locked | layer | true or false | false | Extension (layer edit locking status): the layer is locked against editing. Omitted when saving for archiving. |
Compositing operators
The values of composite-op. The names and maths are those of the W3C
Compositing and Blending specification.
| Value | Blend mode | Compositing | Since |
|---|---|---|---|
svg:src-over | Normal | Source over | |
svg:multiply | Multiply | Source over | |
svg:screen | Screen | Source over | |
svg:overlay | Overlay | Source over | |
svg:darken | Darken | Source over | |
svg:lighten | Lighten | Source over | |
svg:color-dodge | Colour dodge | Source over | |
svg:color-burn | Colour burn | Source over | |
svg:hard-light | Hard light | Source over | |
svg:soft-light | Soft light | Source over | |
svg:difference | Difference | Source over | |
svg:color | Colour | Source over | |
svg:luminosity | Luminosity | Source over | |
svg:hue | Hue | Source over | |
svg:saturation | Saturation | Source over | |
svg:plus | Normal | Lighter (adds the colours) | |
svg:dst-in | Normal | Destination in: keeps what is below only where this layer is opaque | 0.0.4 |
svg:dst-out | Normal | Destination out: erases what is below where this layer is opaque | 0.0.4 |
svg:src-atop | Normal | Source atop: draws only where there is something below | 0.0.5 |
svg:dst-atop | Normal | Destination atop | 0.0.5 |
The specification says more operators may be added, and that a way for programs to define their own is planned.
Layer images and proposals
Layer images are PNG files in practice. Exact requirements for PNG layer data, and features such as animation, several pages, filter effects, embedded fonts, palettes, undo history, XMP metadata and alpha-preserve locking, are still proposals on the OpenRaster site and not part of version 0.0.6.