From GIMP Developer Wiki
Last updated: 24.05.2013
How to port
This is the general process to write a new GEGL operation:
- Gather information.
- Read the plugin you want to port, understand the algorithm hidden in it.
- Read carefully the GEGL website. There is lot of information here.
- Read the Babl website and understand the difference between color models.
- You may want to find a similar existing operation and get inspiration from it.
- Choose a base class. This is the general structure of your operation, the number of input/output, what kind of optimization GEGL can do.
- Create a new file for your operation. No need to register it in some Makefile, the build system will build every C file present in the operations directory. The exact directory where you should put your file is explained in the GEGL website.
- Copy another operation with the same base class and clean it to have your operation skeleton. GEGL use a macro system called GEGL chant, that avoid you to write all the GObject boilerplate, and register easily parameters for your op. Look other operation to see how it works.
- Use the prepare function to indicate what color model your op will operate, for each input/output.
- Create your op's parameter using the chant system. You can have integer, floats, string, color, curve, enum ... There is some predefined enum in the GEGL core, for instance GeglSamplerType. You can register your own, like in the ripple op.
- Write your operation in the process function. Some tips here:
- GEGL store data in tile, so it impose some restriction, especially for transform op. You usually need to write your algorithm backward, ie iterate over the output, compute where the data come from, use a sampler to get it and affect the output.
- ROI mean region of interest, it's the area your are currently working on.
- Sometimes you need to know the size of the full input, not just the roi. You can have it using gegl_operation_source_get_bounding_box.
- Rather than carry a lot of parameter in you different functions, you can register a custom structure in the chant system, like the WarpPrivate structure in the warp op.
- When you fetch data outside of the input buffer (in it's abyss) you get by default zeroed memory. The abyss policy allow you to chose what you want here, and in particular, you can choose to clamp to the border, loop in the buffer extent ... It allows to write more clever algorithm. For instance, see the ripple op. Setting the abyss policy to GEGL_ABYSS_LOOP add the tileability to the op for free.
- Test your operation. You can use the gegl binary to run an xml file, or use the GEGL tool in GIMP.
Porting matrix
You can sort the following tables by clicking the little arrow symbol in the column headers. If that doesn't work out of the box, please activate Javascript for this page.
Processing, color grading and effects
| GIMP filter
| GEGL operation
| Test result
| OpenCL version
| Test result
| Comment
|
| Alien Map | No | untested | No | untested |
|
| Align Visible Layers | No | untested | No | untested |
|
| Antialias | unknown | untested | No | untested |
|
| Apply Canvas | No | untested | No | untested |
|
| Apply Lens | No | untested | No | untested |
|
| Assign Color Profile | No | untested | No | untested |
|
| Autocrop Image | No | untested | No | untested |
|
| Autocrop Layer | No | untested | No | untested |
|
| Border Average | No | untested | No | untested |
|
| Bump Map | No | untested | No | untested |
|
| Cartoon | Yes | untested | No | untested |
|
| Channel Mixer | No | untested | No | untested |
|
| Checkerboard | Yes | failed | No | untested | Missing Psychobilly Option
|
| CML Explorer | No | untested | No | untested |
|
| Color Enhance | No | untested | No | untested |
|
| Color Exchange | No | untested | No | untested |
|
| Color to Alpha | Yes | untested | No | untested |
|
| Colorcube Analysis | No | untested | No | untested |
|
| Compose | No | untested | No | untested |
|
| Convert to Color Profile | No | untested | No | untested |
|
| Convolution Matrix | work in progress | untested | No | untested |
|
| Crop Tool | Yes | untested | No | untested |
|
| CSS stylesheet | No | untested | No | untested |
|
| Cubism | work in progress | untested | No | untested |
|
| Curve Bend | No | untested | No | untested |
|
| Decompose | No | untested | No | untested |
|
| Deinterlace | work in progress | untested | No | untested |
|
| Depth Merge | No | untested | No | untested |
|
| Despeckle | No | untested | No | untested |
|
| Destripe | No | untested | No | untested |
|
| Difference of Gaussians | Yes | failed | No | untested | The port is missing Normalize and Invert options
|
| Diffraction Patterns | No | untested | No | untested |
|
| Dilate | No | untested | No | untested |
|
| Displace | No | untested | No | untested |
|
| Drop Shadow | Yes | failed | No | untested | The GEGL port doesn't have an option for the shadow color and doesn't seem to work in the Mac build.
|
| Edge... | No | untested | No | untested |
|
| Emboss | work in progress | untested | No | untested |
|
| Engrave | No | untested | No | untested |
|
| Erode | No | untested | No | untested |
|
| Filmstrip | No | untested | No | untested |
|
| Filterpack | No | untested | No | untested |
|
| Flame | No | untested | No | untested |
|
| Foreground Select Tool | work in progress | untested | No | untested | See patches to bugs #699780 and #699834.
|
| Fractal Explorer | Yes | untested | No | untested |
|
| Fractal Trace | work in progress | untested | No | untested |
|
| From Webpage | No | untested | No | untested | Probably doesn't need porting
|
| Gaussian blur | Yes | untested | Yes | untested | Needs abyss policy
|
| Gfig | No | untested | No | untested | Probably doesn't need porting
|
| GIMPressionist | No | untested | No | untested |
|
| Glass Tile | No | untested | No | untested |
|
| Gradient Flare | No | untested | No | untested |
|
| Gradient Map | No | untested | No | untested |
|
| Grey | Yes | untested | Yes | untested |
|
| Grid | Yes | failed | No | untested | Missing intersection option, is it needed ?
|
| Hot | No | untested | No | untested |
|
| HSV Noise | Yes | untested | No | untested |
|
| Hurl | Yes | untested | No | untested |
|
| IFS Fractal | No | untested | No | untested |
|
| Illusion | No | untested | No | untested |
|
| Image Map | No | untested | No | untested | Probably doesn't need porting
|
| Invert | Yes | untested | Yes | untested |
|
| iWarp | No | untested | No | untested | To be replaced with Warp Transform tool
|
| Java map | No | untested | No | untested | Probably doesn't need porting
|
| Jigsaw | No | untested | No | untested |
|
| Laplace | Yes | untested | No | untested |
|
| Lens Distortion | Yes | untested | No | untested |
|
| Lens Flare | No | untested | No | untested |
|
| Levels Tool | Yes | untested | Yes | untested |
|
| Lighting Effects | No | untested | No | untested |
|
| Make Seamless | No | untested | No | untested |
|
| Maximum RGB | No | untested | No | untested | Will be removed without replacement
|
| Maze | No | untested | No | untested |
|
| Mosaic | No | untested | No | untested |
|
| Motion Blur | Yes | failed | Yes | untested | The GEGL port is incomplete (no type and center selection)
|
| Neon | No | untested | No | untested |
|
| Newsprint | No | untested | No | untested |
|
| NL Filter | No | untested | No | untested |
|
| Normalize | No | untested | No | untested |
|
| Noise Spread | work in progress | untested | No | untested |
|
| Oilify | Yes | untested | Yes | untested |
|
| Optimize (Difference) | No | untested | No | untested |
|
| Optimize (for GIF) | No | untested | No | untested |
|
| Pagecurl | No | untested | No | untested |
|
| Palette Map | No | untested | No | untested |
|
| Paper Tile | No | untested | No | untested |
|
| Photocopy | Yes | untested | No | untested |
|
| Pick | Yes | untested | No | untested |
|
| Pixelize | work in progress | untested | Yes | untested | Needs abyss policy
|
| Plasma | work in progress | untested | No | untested |
|
| Playback | No | untested | No | untested | Probably doesn't have to be ported ?
|
| Polar Coordinates | Yes | untested | No | untested |
|
| Posterize Tool | Yes | untested | No | untested |
|
| Qbist | No | untested | No | untested |
|
| Recompose | No | untested | No | untested |
|
| Red Eye Removal | work in progress | untested | No | untested |
|
| Retinex | No | untested | No | untested |
|
| RGB Noise | Yes | untested | No | untested |
|
| Ripple | Yes | untested | No | untested | Complete in abyss branch
|
| Rotate Colors | work in progress | untested | No | untested |
|
| Sample Colorize | No | untested | No | untested |
|
| Selective Gaussian Blur | No | untested | No | untested |
|
| Shift | Yes | untested | No | untested |
|
| Sinus | No | untested | No | untested |
|
| Slur | Yes | untested | No | untested |
|
| Smooth Palette | No | untested | No | untested |
|
| Sobel | Yes | untested | Yes | untested |
|
| Softglow | Yes | untested | No | untested |
|
| Solid Noise | No | untested | No | untested |
|
| Sparkle | No | untested | No | untested |
|
| Sphere Designer | No | untested | No | untested |
|
| Spread | Yes | untested | No | untested |
|
| Stretch Contrast | Yes | untested | No | untested | Not sure we need that with GEGL being the core of GIMP
|
| Stretch HSV | No | untested | No | untested |
|
| Supernova | No | untested | No | untested |
|
| Transform Tools (Rotate, Scale, Shear, Translate) | Yes | untested | No | untested |
|
| Threshold Tool | Yes | failed | Yes | untested | The GEGL port misses setting the upper bound (=the right slider triangle in the GIMP tool).
|
| Tile | Yes | untested | No | untested |
|
| Unoptimize | No | untested | No | untested |
|
| Unsharp Mask | Yes | untested | No | untested |
|
| Value Invert | Yes | untested | Yes | untested |
|
| Value Propagate | No | untested | No | untested |
|
| Van Gogh (LIC) | No | untested | No | untested | The filter has nothing to do with van-Gogh-style art and has no obvious function. We should remove it.
|
| Video | No | untested | No | untested |
|
| Warp | work in progress | untested | No | untested |
|
| Waves | Yes | failed | No | untested | Missing reflective option that produce strange result, I suggest dropping that.
|
| Whirl and Pinch | work in progress | untested | No | untested |
|
| Wind | Yes | untested | No | untested |
|
| Zealous Crop | unknown | untested | No | untested |
|
File loaders/savers
| GIMP filter
| GEGL version
| Test result
| Comment
|
| file-aa | Yes | untested |
|
| file-bmp | Yes | untested |
|
| file-cel | Yes | untested |
|
| file-csource | Yes | untested |
|
| file-desktop-link | doesn't need to be ported | |
|
| file-dicom | Yes | untested |
|
| file-exr-load | Yes | untested |
|
| file-exr-save | Yes | untested |
|
| file-faxg3 | Yes | untested |
|
| file-fits | Yes | untested |
|
| file-fli | Yes | untested |
|
| file-gbr | Yes | untested |
|
| file-gif-load | Yes | untested |
|
| file-gif-save | Yes | untested |
|
| file-gih | Yes | untested |
|
| file-glob | No | untested | for file globbing -> is GEGL-port necessary?
|
| file-header | Yes | untested |
|
| file-html-table | Yes | untested |
|
| file-ico | Yes | untested |
|
| file-jp2-load | Yes | untested |
|
| file-jpeg | work in progress | work in progress |
|
| file-mng | Yes | untested |
|
| file-pat | Yes | untested |
|
| file-pcx | Yes | untested |
|
| file-pdf-load | No | untested |
|
| file-pdf-save | Yes | untested |
|
| file-pix | Yes | untested |
|
| file-png | Yes | work in progress |
|
| file-pnm | Yes | untested |
|
| file-ps | work in progress | work in progress |
|
| file-psd | No | untested |
|
| file-psp | Yes | untested |
|
| file-raw | No | untested | see GEGL-op gegl:raw-load
|
| file-sgi | Yes | untested |
|
| file-sunras | No | untested |
|
| file-svg | No | untested | extra GEGL-op gegl:svg-load exists for loading SVG and SVGZ format
|
| file-tga | Yes | untested |
|
| file-tiff-load | Yes | untested |
|
| file-tiff-save | work in progress | work in progress |
|
| file-wmf | No | untested |
|
| file-xbm | Yes | untested |
|
| file-xmc | No | untested |
|
| file-xpm | Yes | untested |
|
| file-xwd | No | untested |
|
New File loaders/savers
These file loaders/savers are implemented in GEGL, but not part of GIMP (yet).
Currently they are listed here for completeness.
| GEGL filter
| GIMP filter
| Test result
| Comment
|
| ff-load | No | untested | FFmpeg video frame importer
|
| ff-save | No | untested | FFmpeg video frame output sink. GEGL op is work in progress.
|
| rawbayer-load | No | untested | RAWBAYER and RAWBAYERS format. GEGL op is work in progress
|
| rgbe-load | No | untested | for Radiance HDR format with extensions HDR and PIC
|
| rgbe-save | No | untested | for Radiance HDR format with extensions HDR and PIC
|
| svg-load | No | untested | for SVG and SVGZ format
|
Port of new GEGL ops to OpenCL
| GEGL operation
| OpenCL version
| Test result
| Comment
|
| Bilateral filter | Yes | untested |
|
| Box blur | Yes | untested |
|
| Box max | No | untested | GEGL op is work in progress.
|
| Box min | No | untested | GEGL op is work in progress.
|
| Box percentile | No | untested | GEGL op is work in progress.
|
| Brightness and Contrast | Yes | untested |
|
| Buffer cache | No | untested | GEGL op is work in progress. Does this need an OpenCL port?
|
| C2g | Yes | untested | HDR related
|
| Cielch Noise | No | untested |
|
| Color | No | untested |
|
| Color Reduction | No | untested |
|
| Color Temperature | Yes | untested |
|
| Contrast Curve | No | untested |
|
| Demosaic (bimedian) | No | untested | GEGL op is work in progress.
|
| Demosaic (simple) | No | untested | GEGL op is work in progress.
|
| Disc percentile | No | untested | GEGL op is work in progress.
|
| Display | No | untested | Does this need an OpenCL port?
|
| Ditto | No | untested | GEGL op is work in progress. Test op - does this need an OpenCL port?
|
| Dot | No | untested |
|
| Exp combine | No | untested | HDR related
|
| Exposure | No | untested | HDR related
|
| Fattal02 | No | untested | HDR related
|
| gluas | No | untested | GEGL op is work in progress. Does this need an OpenCL port?
|
| HStack | No | untested | GEGL op is work in progress.
|
| Image compare | No | untested |
|
| Introspect | No | untested | Does this need an OpenCL port?
|
| Kuwahara | No | untested | GEGL op is work in progress.
|
| Lens correction | No | untested | GEGL op is work in progress.
|
| Line profile | No | untested | GEGL op is work in progress.
|
| Linear gradient | No | untested | GEGL op is work in progress.
|
| Mandelbrot | No | untested | GEGL op is work in progress.
|
| Mantiuk06 | No | untested | HDR related
|
| Mirrors | No | untested |
|
| Mono mixer | Yes | untested |
|
| Noise | No | untested | Perlin noise generator
|
| Noise Reduction | Yes | untested |
|
| Over | No | untested | Porter Duff operation over (d = cA + cB * (1 - aA))
|
| Radial gradient | No | untested | GEGL op is work in progress.
|
| Reinhard05 | Yes | untested | HDR related
|
| Remap | No | untested |
|
| SNN (mean) | Yes | untested |
|
| SNN (percentile) | No | untested | GEGL op is work in progress.
|
| SVG Hue rotate | No | untested |
|
| SVG Luminance to Alpha | No | untested |
|
| SVG Matrix | No | untested |
|
| SVG Saturate | No | untested |
|
| Unpremul | No | untested | GEGL op is work in progress.
|
| Vignette | Yes | untested |
|
| Weighted Blend | No | untested |
|