Saturday, March 31, 2012

Very big steps towards finishing post GSoC (2011) work

It works!

An outline and it's refinement

If you have been tracking my blog, you saw that I was struggling in the last few weeks to implement a constrained delaunay refinement algorithm. It took ages, as I always encountered lack of available materials and/or programming bugs. But I'm here to say that it works now!
This implementation is in C# (easier to prototype algorithms than in C), and I will convert it to C later for usage with GIMP and the rest of the project. It's based on a paper by Jonathan ShewchukDelaunay Refinement Algorithms for Triangular Mesh Generation.

Now, what about the GEGL side of the project?
As you may have all heard, GIMP is progressing onwards to use GEGL as it's image processing core. My seamless clone tool is not different - it was written as a GEGL operation (meaning you can use it outside of GIMP, in your own programs!). The GEGL operation has received lots of work this week, including:
  • Working in tiles instead of whole at once (reduces memory usage and makes it scalable for images as large as supported by GEGL)
  • Bug Fixing and Compiler calming (making the warnings disappear)
  • Removing code duplication
The op is pretty much done now! I will need to use the new triangulation algorithm (as mentioned above), but it should be transparent to the rest of the code.

Now, what about the GIMP side of the project?
Other than a bit nicer looking GUI for tuning some settings, it's already done since the summer.

Remaining TODO:
  • Make the GEGL operation handle blank images to paste and images with very thin (1 pixel wide) areas. Also make it handle holes (I would probably warn about these and refuse to paste).
  • Port the triangulation algorithm to C
    • Also finally make it a standalone package...
  • Improve a bit the GIMP user interface for the tool
  • Bonuses:
    • Implement an OpenGL and/or a OpenCL (I'm unfamiliar with openCL, and this op is actually very easy with OpenGL) version of the seamless clone operations, to speed things up even more.
    • Code optimizations....
That's it for now. I'm off to bed...


  1. Cool dude! I don't know that much about the triangulation algorithm, but already looks pretty impressive to me. Good work LightningIsMyName!

  2. woo! great stuff :-)

  3. Can I use it for triangulation for my house? I am making plans for my house and I do not know what to use to do it good!