I asked about performance on the gimp mailing list. If all you want to do is call a bunch of pdb calls, then a tiny-fu scheme script will perform as well as a python or compiled C plugin. Where python and C will show improvement is in lower level access to the image, i.e. reading or manipulating the image data directly. So I wouldn't expect much speed improvement on the flatten. The multifill code is at it simplest a nested loop walking the image, looking for white. When it finds the white, it does a magic wand select then fills it appropriately. I added a few optimizations, like a select by colour (white) to get the bounds for the next iteration of the loop after finding white. If the bounds haven't changed, continue scanning the X; if it has changed start scanning from the upper left corner of the new bounds. Another optimization was to keep a channel copy of the selection = the white space. Rreading the xy value in a channel is faster then reading the colour. -Rob A>
Fantastic. Thanks very much.
Follow this: http://wiki.gimp.org/gimp/HowToCompi...crosoftWindows which is the easiest way to set up a gimp compile environment, and compile gimp. This will also give you the gimptool-2.0 application and libs all set up for compiling plugins. -Rob A>
Here is a zip with the windows compiled plugin as well as the c code modified to register the plugin in the vector menu. You can diff it to see the required changes. http://ffaat.pointclark.net/incoming/smooth-path.zip
I have compiled it under windows. It would be real nice to get it under the Vectors menu so it shows up as a right click in the path panel. I'll ask on the gimp developer list, OK? -Rob A>
heh - devil is always in the details -Rob A>
I don't care. I rarely use or recommend the tapered stroke script anymore, as I use inkscape for must of my vector work. If you improve gimp's handling of vectors, that would only be an improvement! -Rob A>
If you don't use too many crazy dependencies I should be able to compile for windows, as I have a minGW/Msys build environment set up. -Rob A>
good luck with the c code. are you linux or windows?
Are you sure? I will describe the algorithm in pseudocode and words, because I don't want you scratching your head over my spaghetti Pascal or C code (which has a lot of extra confusing baggage added to it). OK done. Here is my description/pseudocode of the algorithm: http://www.ludicity.org/files/algorithm.txt If it seems like too much work, don't worry about it, or just send me a starting template of script code, and then maybe I can try to do it myself. Whatever the case, thanks for your time.
Administrator