<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet href="/style/browser.xsl" type="text/xsl"?>
<essay xmlns="http://docbook.org/ns/docbook"
       xmlns:xlink="http://www.w3.org/1999/xlink"
       xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
       xmlns:dc='http://purl.org/dc/elements/1.1/'
       xmlns:dcterms="http://purl.org/dc/terms/"
       xmlns:gal='http://norman.walsh.name/rdf/gallery#'
       xmlns:foaf="http://xmlns.com/foaf/0.1/"
       xml:lang="en"
       version='5.0'>
<info>
<title>XCF: bah, humbug!</title>
<volumenum>9</volumenum>
<issuenum>59</issuenum>
<pubdate>2006-06-18T10:10:23-04:00</pubdate>
<date>$Date: 2006-07-21 13:27:50 -0400 (Fri, 21 Jul 2006) $</date>
<author><personname>
<firstname>Norman</firstname><surname>Walsh</surname>
</personname></author>
<copyright><year>2006</year><holder>Norman Walsh</holder></copyright>
<abstract>
<para>I know the calendar is almost exactly out of phase with Christmas,
but “bah, humbug” anyway. Gimp's XCF file format is deliberately
undocumented. Bah freaking humbug! [Update: a spec is under development!]
</para>
</abstract>
</info>

<para xml:id='p1'>I've been starting recently to take my photography a
little more seriously. Partly, that means setting time aside sometimes
just to try to improve my technique and to take a lot of (mostly
mediocre, at best) pictures. (Taking lots is the only way I know to learn how
to take better ones.) Partly, it means I've been trying to better
understand and appreciate the digital image work flow process.</para>

<para xml:id='p2'>And that means I've been spending more time in
<link xlink:href="http://en.wikipedia.org/wiki/GIMP">GIMP</link> trying
to understand how to process
<link xlink:href="http://en.wikipedia.org/wiki/RAW_image_format">raw
images</link> from the camera and learn about things like
layer masks and sharpening.</para>

<para xml:id='p3'>And now
<link xlink:href="http://diveintomark.org/archives/2006/06/16/juggling-oranges#riskfactors">I learn</link>
that GIMP's native file format,
<link xlink:href="http://en.wikipedia.org/wiki/XCF">XCF</link>,
is not merely undocumented, it is <emphasis>intentionally</emphasis>
undocumented.</para>

<blockquote>
<para xml:id='p4'>Danger, Will Robinson! Undocumented binary black
hole! Danger!</para>
</blockquote>

<para xml:id='p7'>I don't claim any particular expertise in designing graphic file
formats, though I've reverse engineered a few simple ones in my day,
but the right answer here seems pretty clear. As near as I can tell,
an XCF file consists, logically, of several bitmaps of varying sizes and depths,
some metadata relating them, and a bunch of ancillary data (palettes,
brushes, selections, etc.). Pick some straightforward encoding for
the bitmaps
(<link xlink:href="http://en.wikipedia.org/wiki/Run-length_encoding">RLE</link>,
<link xlink:href="http://en.wikipedia.org/wiki/LZW">LZW</link>, or anything
lossless, really), design an XML format for the rest of the data,
and package them all together somehow (maybe
<link xlink:href="http://en.wikipedia.org/wiki/ZIP_%28file_format%29">ZIP</link>,
maybe
<link xlink:href="http://en.wikipedia.org/wiki/List_of_archive_formats">something
else</link>). I don't see any particular merit in
<link xlink:href="http://en.wikipedia.org/wiki/Base64">base64</link> or
otherwise encoding the binary data directly into the XML, but I don't see
why that should prevent the rest of the data from being in XML.</para>

<para xml:id='p5'>I really don't know, right now, what the right
answer is, but pouring more of my heart and soul into someone's
proprietary black hole isn't it.</para>

<para xml:id='p6'>Bah #@$&amp;!?% humbug!</para>

<para xml:id='p8'>[Update, 20 June 2006: Based on Sven's comments below and
<link xlink:href="http://blogs.gnome.org/view/bolsh/2006/06/19/0">other
postings</link>, it seems that perhaps the situation isn't as dire
as it first appears. I hope this turns out to be the case,
because I really care about this data.]</para>

<para xml:id='p9'>[Update, 21 July 2006: <foaf:name>Dave Neary</foaf:name>
<link xlink:href="http://blogs.gnome.org/view/bolsh/2006/07/12/2">reports</link>
that <foaf:name>Henning Makhomlm</foaf:name> has stepped up to write
<link xlink:href="http://henning.makholm.net/xcftools/xcfspec.txt">a
specification</link> for the XCF format. Good on ya, Henning!</para>

</essay>
