0

Is there any C/C++ library that I can use to write GIMP xcf files? I want a standalone library that does not depend on the GIMP source (because it is to much work do separate things out from this huge program)?

user877329
  • 6,717
  • 8
  • 46
  • 88
  • If there is no such library I want to know a raster graphics format that: * Supports layers * Can be opened in GIMP * For which there exists a library to use for writing – user877329 Feb 19 '12 at 17:16

1 Answers1

0

Some KDE applications can read .xcf files - so I suspect that if you use KDE libraries, you cna get to read, not shure if it is possible to write .XCF files.

Otherwise, GIMP developers usually advise against separate implementations of access to .xcf file, so that they keep the freedom to change the file format as the program evolution requires it.

An open file format specification for multi-layer graphic images is "Open Raster" - There is a Python gimp plug-inf or reading and writing open-raster, it is the default file format for the MyPaint application - I don't know if there are any C or C++ libraries that can currently deal with OpenRaster files - the specification can be found here:

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

(it is basically a .zip archive, with the raster data stored in .png s and XML for the relationship between the png files and metadata)

jsbueno
  • 99,910
  • 10
  • 151
  • 209
  • I will just save all layers in a directory and then "Open as layers". – user877329 Feb 22 '12 at 09:02
  • Which is a nice workaround :-) - one other way to go is to write a small gimp-daemon plug-in that would serve your program the raw image-data for a layer upon request. You'd run GIMP without an interface, and let this plugin running, maybe listening to a socket, or http, and it could provide data over http or temporary files. – jsbueno Feb 22 '12 at 19:58