Open Raster Format

http://create.freedesktop.org/wiki/OpenRaster

I’ve been using png for pretty much all my images, but it gets annoying when you start dealing with layered images (such as masks for colour tinting a sprite, or shared colour+normal maps, or images defining level layouts). It’d be nice to start using proper layered images directly and skip an extra export step in my toolchain.

Seems to be supported by Paint.NET, Gimp and Pinta, so that’s all the platforms I care about covered too.

Anyone used or is using this? It looks like a nice sane format so I might try and write a little lib to open the files in java. Alternatively, is anyone using any other alternatives for layered, cross platform images?

I hadn’t heard about openraster before now. Looks interesting. I can’t answer any of your questions, but I’d like to thank you for the find. :slight_smile:

As i was looking for a layered graphic file format that could be read/written in Java, I found the openraster format as well as a lib that seems to allow this :
https://code.google.com/p/mediaz/source/browse/trunk/ImageZ/src/imagez/io/OpenRaster.java

I’m going to give it a try, as PSD can be read easily with http://code.google.com/p/java-psd-library/ but writting however is not handled by the library.

I wrote lately some classes to load SRTM(NASA height profile of the earth) images with the standard Java ImageIO, if one provides the code to read write OpenRaster images I can wrap it so one can load the images with standard java.

Like:
BufferedImage a = ImageIO.loadImage(“test.ors”);//don’t know the file ending

if interested just open i.e. a GitHub project

An easier option would be to store a layered image as a collection of png images in a zip file.

it is true that a file format which supports this natively would save some time, when one uses a paint programm like gimp. Then when you have to pack all the files your self

But wouldn’t it be easier to write a gimp script that saves multiple layers as separate images then to write an Open Raster reader for Java?
e.g.
http://ubuntuforums.org/showthread.php?t=555437

I think for the most of us, yes it would be easier to write a decoder in Java :slight_smile:

The specifications are rather simple :
http://www.freedesktop.org/wiki/Specifications/OpenRaster

The ImageZ library I was mentionning does not support writing yet.
However this is pretty simple to code.

Basically, the file is a zip containing a xml descriptor of the layers, the layers as png and a thumbnail.

I just wrote this loader, which uses Romain Guy’s BlendComposite (if blending is not SRC_OVER).

[x] http://pastebin.java-gaming.org/270b3685716

Writing an ORA writer from this code should be a piece of cake (but I’m too lazy).