Converting Plug-ins
I'm investigating converting existing plug-ins from 2.8 to use GEGL.
It appears that one would implement the calculations in GEGL, leave the
interface and parameter input code pretty much as is, and then pass the
parameters to the GEGL code from GIMP plug-in code (making two plug-ins,
actually). Am I missing something?
Handling previews effectively seems like a task better left to GEGL or a
generalized GIMP callback than being done in each plug-in.
Algorithm question, using despeckle.c as a starting point:
The "median" algorithm uses luminance of the pixels around the point of
interest, creates a histogram of 256 levels of luminance, throws those
below and above a user specified threshold out, finds the median level
of luminance, and then chooses randomly from the pixels that have that
level of luminance. This would seem to choose a random color with an
appropriate luminance from the region. Seems to me this makes the
algorithm useful for gray scale images that are not black and white. Only
The literature is full of other despeckle algorithms. The code itself
mentions 4, including "adaptive" but appears to implement none of them.
Handling the following all seem worthy at some point 1) black/white
images, 2) maintaining detail and contrast while smoothing larger areas
of more closely matching pixels, 3) separating luminance or value from
color.
Questions:
Is renaming for example despeckle to despleckle-median easy to do in the
future or is it somehow easier during the initial conversion process? My
own preference would be to use a new more specific name in GEGL and keep
the old despeckle name for now in GIMP, though adding a method parameter
could also work for the GEGL code.
If I do take on a conversion, is it acceptable if I include comments
explaining the algorithm, or will they just be deleted?
If I include comments about when the algorithm seems useful, will those
just be deleted?