Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is pretty conjectural, so perhaps not an appropriate question. If you're of the opinion that I should instead be asking where to pose such a question, please feel free to redirect me.

To my knowledge, working with image files is accomplished by making a series of edits to those files, which are then saved as a new version of the file containing the new state. Although the files themselves may be in a parseable text format (though this is not true in the case of photoshop or GIMP files), and the actions performed may be undoable, I'm not aware of any graphics editing system whose file format is a series of steps performed on a set of source images; it's my understanding that most image file formats are declarative rather than procedural in nature.

My thinking is that storing a set of steps rather than a state would be a very sensible way to save an image file, since it would allow for the saving of a complex history without saving large binary bits multiple times. This would also allow for versioning to be readily managed by SCM systems, even alleviating the need to lock image files as is commonly done for when working on shared media in Photoshop or GIMP.

A local compiled version of the image would serve as a cache: it would be kept updated and be used to avoid having to rebuild the state of the resulting image each time it was opened.

Ideally it would be possible to re-apply various steps in the creation of the final image, or modify the parameters of those steps, with minimal complication. Being able to pull consecutive steps out and parameterize them for future use as macros could conceivably become very convenient to implement.

Is there a useful image editing system which works in a way similar to this? I'm getting a bit annoyed at a perceived lack of versatility in gimp: I want it to work a bit more like vim.

Tips on how to do similar things in GIMP (perhaps using Python-fu) are also quite welcome, though perhaps most appropriately as comments rather than answers.

My use requirements are something that's open source and runs under linux, but I'm interested in hearing about any and all systems which work this way, regardless of licensing or portability status.

share|improve this question

Well, in a sense, existing image formats could qualify as what you're looking for, since what is a bitmap image but a series of "instructions" saying "set color of pixel XXX to YYY"? Or an SVG image - that's an XML file containing instructions like "draw line from A to B" or "place blue filled circle of radius R at point P." I see what you're saying about wanting something more than that, a format that stores the actual series of steps you actually used to create the image, but that may be asking a bit much. I mean, not just among images, but even for audio files, text files, or word processing documents, is there any file format that stores the exact series of actions used to create the content? I can't think of any.

Here's another thing to think about: an image file format consisting of the ordered instructions to create the picture would basically be a computer program or script, not something that most people would really consider an image. It has been done, though. For instance, for the images I use on my website, I often like to create a script containing a set of commands that will recreate the image, and I save the script in my source control system or whatever. The commands themselves could be e.g. ImageMagick commands; I personally like to use the TikZ package for LaTeX. (There's a nice little editor for TikZ called CirKuit that offers an auto-updating preview of the picture as you create it; it's not WYSIWYG but other than that it's probably the closest thing I've seen to what you're asking about.)

share|improve this answer
The only file format I can think of offhand that works this way is that of a source code repository like git: "actions" are stored as individual commits. Although not entirely fluid, and not parametrizable, this does allow "actions" to be "reapplied", removed from the sequence, or modified. – intuited Jul 8 '10 at 0:53
Most editors offer the ability to store an undo history, though I'm not sure which, if any, are flexible enough to allow modification of the parameters of the actions in that history. But hey, why not? – intuited Jul 8 '10 at 0:53
Thanks for the lead on TikZ/CirKuit, that sounds interesting. I'm really looking for a programmable editor more so than a scripting language per se. Although I listed vim as an example, even it is not entirely able to do what I want: for instance there's no way to grab the last few commands and store them/parametrize them; you have to plan that out in advance by recording them. I'm not (yet?) an emacs user; it may be that emacs provides a better role model here. – intuited Jul 8 '10 at 1:09
@intuited (3 comments up): I had the same thought, that a revision control system is the closest thing in the wild to what you're asking about. A lot of people tend to think an RCS is good enough at recording history, that they don't need to keep every single individual action, but I can see how that would be useful in an image editor. The UI could get pretty complicated, though. – David Z Jul 8 '10 at 3:09
the thing that got me thinking about this was just using gimp, and actually wondering why I couldn't just go back and change the parameters that I'd chosen to apply to a particular action recorded in its undo history. Or select a bunch of them and pull that out into some "macro list" or something, and then be able to, if necessary, edit it as code in Python or whatever. I'm thinking of actions like the stuff in the Filters menu more so than "interactive" edits, but in theory that could be done too; parameters would be things like the starting location of an airbrushing. – intuited Jul 8 '10 at 3:27

It's been done. The pre-OS X macintosh "pict" format was a series of coded QuickDraw commands. And you can certainly do something very similar in postscript (i.e. just record the calls necessary to draw the image after some set of primitives have been defined).

share|improve this answer
Neat! Although I'm most interested in using transformations, shading, and other operations similar to those provided by gimp, on existing raster graphics, it would be great to find a modern, WYSIWYG graphics editor that facilitates working with postscript in such a versatile manner. – intuited Jul 8 '10 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .