nonlinear revision control system for GIMP
This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.
This is a read-only list on gimpusers.com so this discussion thread is read-only, too.
nonlinear revision control system for GIMP | Tim Chen | 02 May 16:00 |
nonlinear revision control system for GIMP | Martin Nordholts | 02 May 16:49 |
nonlinear revision control system for GIMP | Tim Chen | 03 May 13:11 |
nonlinear revision control system for GIMP | Martin Nordholts | 03 May 20:20 |
nonlinear revision control system for GIMP
Hi all,
Recently we have published a paper on SIGGRAPH 2011 about nonlinear revision control system for images. You can find the abstract and videos at
https://sites.google.com/site/httimchen/2011_imagesvn
As described in the abstract, the core idea is to record users' actions and transform it into a DAG representation where nodes are actions and edges there dependency. With the DAG, we are able to implement all important revision control functions, including add, branch, diff, merge.
Although our prototype is tightly coupled with GIMP, we design our system for easy porting between different image editing systems. There are three main independent components in our system, image editing software (GIMP), revision control system (GIMP plugin) and renderer (GTK+). And ideally, we can replace any of them if necessary.
For now, the most messy part is on the image editing software, i.e. GIMP, in this case. To achieve all fancy functions you saw on the video, the image editing software basically does two things: log user actions (action name, selected region and parameters) and replay the actions. The replay part is simple with libgimp, but the log part is missing in current GIMP.
In this project, I implement all these stuffs on my own. And to meet the SIGGRAPH submission deadline, I simply hack the GIMP core by inserting functions that would output the corresponding logs in text into corresponding functions (for example, inserting the output function into the color_balance_config_notify() at app/tools/gimpcolorbalancetool.c to record users' action of applying color balance...etc). And obviously, this is an ugly hack.
I would really love to put our system upstream so that everyone can enjoy it and the ultimate goal here is to replace the current backend completely with GEGL. But a much simpler and faster way to do so is probably by implementing some sort of macro system in the GIMP first?
So, I am wondering
1) is there anyone implementing the macro/script system
and
2) can anyone give me a head start on how should I modify my hack so that it is more readable to others? Spreading the log function into tens of files certainly breaks most guideline one should follow when writing object-oriented program :D
Regards, -Tim
nonlinear revision control system for GIMP
2011/5/2 Tim Chen :
Hi all,
Recently we have published a paper on SIGGRAPH 2011 about nonlinear revision control system for images. You can find the abstract and videos at
Hi Tim
That's great stuff.
1) is there anyone implementing the macro/script system
Nope there isn't, so you are more than welcomed to start doing that. FYI, macro recording is on our roadmap found at http://wiki.gimp.org/index.php/Roadmap.
2) can anyone give me a head start on how should I modify my hack so that it is more readable to others? Spreading the log function into tens of files certainly breaks most guideline one should follow when writing object-oriented program :D
I'm convinced (others are not) we should use the proven http://en.wikipedia.org/wiki/Command_pattern and http://en.wikipedia.org/wiki/Composite_pattern for macro recording and wrote some patches a while ago that introduced a GimpCommand and a GimpGroupCommand class. I didn't have time to even turn it into a working prototype however.
It will be necessary to make some extensions to the above patterns. For example, you may have noticed that GIMP is quite quick to Undo and Redo, in particular for time consuming pixel processing operations. That's because the undo stack contains the tiles with the resulting pixels, not only parameters used to get that result. When Redoing, the tiles with the result can quickly be applied.
I'm imagining that we'd have code that would look something like this:
gimp_expensive_command_execute (...)
{
if (gimp_expensive_command_result_cached (...))
gimp_expensive_command_apply_cached_result (...);
else
// Do time-consuming stuff
}
We don't want to start each GimpCommand with that if case though, so an abstraction will be needed.
This is not a trivial refactoring, but we need to do it eventually.
Best regards, Martin
nonlinear revision control system for GIMP
On May 3, 2011, at 12:49 AM, Martin Nordholts wrote:
I'm convinced (others are not) we should use the proven http://en.wikipedia.org/wiki/Command_pattern and http://en.wikipedia.org/wiki/Composite_pattern for macro recording and wrote some patches a while ago that introduced a GimpCommand and a GimpGroupCommand class. I didn't have time to even turn it into a working prototype however.
Hi Martin,
It sounds like that there are other thoughts about how to implement the macro system? During my GIMP hack last year, my impression was that macro recording should be done in PDB. And I did not do so because not every functions went through PDB, e.g. those stroke functions (please correct me if my memory did not serve me right).
This is not a trivial refactoring, but we need to do it eventually.
Yes, this is non-trivial and I am certainly not the best one to do such heavy duty stuff. And I still don't feel too comfortable seeing all those GObject and Glib stuffs...I guess I will first release my hacked and messy GIMP version for researchers first...
In any case, the GIMP community helps me a lot and I do like to contribute something back, i.e. integrate my system into GIMP core.
Regards, -Tim
nonlinear revision control system for GIMP
2011/5/3 Tim Chen :
Hi Martin,
It sounds like that there are other thoughts about how to implement the macro system? During my GIMP hack last year, my impression was that macro recording should be done in PDB. And I did not do so because not every functions went through PDB, e.g. those stroke functions (please correct me if my memory did not serve me right).
There have been discussions of other approaches than the Command design pattern. Making use of the PDB somehow probably is a good idea, although that won't work for things that a use can do but that w don't have PDB calls for yet.
In any case, the GIMP community helps me a lot and I do like to contribute something back, i.e. integrate my system into GIMP core.
That sounds great. The best way to take in a large thing like this is by doing it step by step. Divide your work into small commits that we can take in upstream piece by piece without introducing any bugs or regressions. Eventually you'll have the platform you need to land the final parts that enables your work for users.
/ Martin