views:

13

answers:

0

I'm writing a simple bitmap editor for Android that supports layers. The state stored in memory for the image being edited is:

  • A series of bitmaps, where each one represents a layer of the image.
  • Each bitmap has an associated opacity integer and a visibility flag.

I want to add saving/loading for this state information. My plan was to pick an existing file format for this as then I can test my files in other editors and I can rely on an existing stable file format instead of evolving my own. A bonus feature is that users could open these files in popular editors e.g. photoshop. What would be a suitable file format?

Something easy to implement would be nice. As I'm working on Android, I have a simple+fast way to save the bitmaps as .PNG files. I'm aware PNG files can store layers but I cannot see any simple way to do this in Android and creating such a file manually looks complex. Are there any libraries I could use to help? I've considered using the file format Photoshop but this also looks rather complex to support.

I originally was just going to save my files as .zip files that contained one .png for each layer and a single XML file that contains the meta-data. Are there any existing formats like this?