Kelly Lynn Martin wrote:
> On Fri, 7 Jan 2000 23:40:02 +1100 (EST), Paul F Harrison <[EMAIL PROTECTED]> said:
> >I have made a plug-in that does some interesting things, like applying
> >a theme taken from one image and applying it to another, or making an
> >image tilable. More details at
> >This is my first plug-in (and my first post to this list). Any comments
> >would be appreciated, especially about any GIMP conventions i may have
> >inadvertantly missed.
> It's incredibly slow, probably because you did a naive iteration
> across the image instead of using pixel regions. Doing direct
> iterations across a gimp image thrashes the system badly and is an
> evil thing to do. Please rewrite your code to use pixel regions and
> rerelease. (I'd do it myself but I'm on other tasks ATM.)
Actually the first thing this plugin does is copy the pixel data into it's own
process so there is no extra data thrashing going on (though it may be able to
benefit from a call to gimp_tile_cache_ntiles). Copying all the pixel info
locally isn't exactly something that we should encourage plugins to do, but given
the multipass nature of this plugin it seems a reasonable thing to do.
The slow part of the plugin is finding the best matches between the input image
and the corpus image. I might suggest using a BSP tree or a multidimensional
hash to speed that part of the process up, though I'm not sure if either of those
would really be faster than the current qicksort like algorithm. One other
possible optimization would be to disregard duplicated patches from the corpus
PS: This plugin is very cool, congratulations to the author!