G'MIC for OpenFX and Adobe plugins

Hi guys,

let me tell you about my recent project, making G’MIC effects usable in Adobe After Effects and Adobe Premiere Pro (other possible hosts or a generic OpenFX interface probably coming later).

In the last days, I have coded “G’MIC bridge”, a shared library/DLL interface for G’MIC that makes accessing G’MIC from other applications and compilers much much easier. Think of it like a “CLI deluxe” C/C++ interface where in addition to the command line you can send pixel buffers for processing to it.
On Windows, this DLL can be compiled in both Visual Studio and MinGW, but since only MinGW supports OpenMP (which is essential for fast processing!), that is the preferred compilation platform. As the library uses a pure ANSI-C interface without any dependencies on G’MIC headers/libs, a MinGW compiled DLL/lib can however be used in Visual Studio and vice-versa.

To test this bridge, I created an effect plugin using the Adobe After Effects SDK that sends the pixel buffers it receives from the host to the bridge DLL for processing. It allows entering any G’MIC commands you want for sending to G’MIC.
The AE plugin can also parse the G’MIC #@gimp definitions and re-create the appropriate native AE UI elements like sliders, text boxes, color pickers, etc. It can also optionally use inplace processing (for effects that don’t require re-assigning the input pointer) and can deal with multiple input layers. Since an AE plugin can only host one single plugin with a fixed parameter set and name within one file, I wrote a little pre-processor that creates small AE plugin stubs from a G’MIC collection file (like the G’MIC standard library). As the processing code is handled in the bridge DLL anyway, these stubs only need some kilobyte of space. The advantage of using the G’MIC GIMP notation is that After Effects users could write plugins that would be immediately compatible with the G’MIC Gimp plugin.
The plugin is also usable in Premiere Pro, supports up to 32bpc float color depth, and all parameters are keyframeable/automatable using the host.

I exported 330+ Gimp effects from the G’MIC standard library for testing last night and most of them worked fine already in After Effects/Premiere Pro!
I was quite surprised though that even more complex effects like the skeleton effect (in the screenshot below) or inpainting using patches worked great as a native AE version (where one can interactively paint using the AE tools on areas to be removed).

Performance can be a bit sluggish sometimes of course and some effects are real memory hogs, but that was to be expected. :smile:

The bridge principle is the same when being applied to other frameworks like OpenFX or FinalCut or Photoshop SDKs, I just started with AE since that is where I do my commercial VFX development work as well and I know this plugin standard best. But I have also already written a generic interface for OpenFX in the past and that part of the sources should be easily adoptable to the G’MIC bridge. Actually I plan to tackle this once my AE plugin is stable enough to be released.

Oh yeah, and of course both the bridge DLL as well as the After Effects plugin will be released with full sources under an open-source license.

I need some more time needed to finalize the plugin and the bridge interface as well as to iron out bugs and errors, but if anyone wants to beta test the plugin(s), just let me know (currently Windows only, AE/PPro CS6 or above needed).

Cheers,
Toby

6 Likes

This is fantastic! :smiley: Do I see a beginning of some very trippy video renders coming? :wink:

Another screenshot, this time showing the Rodilius effect (which uses the FFTW library internally). You can also see the preview mode with split screen, the automation of three parameters in the timeline and the tree view of all G’MIC plugins in the effect browser on the right side. Cool, eh?

3 Likes

That’s awesome Tobias, congrats!

Any possibilities to port G’MIC in PhotoShop. I know a heck of a lot of PS users that would be happy (not me; I’m a GIMPer; just other folks at other forums I frequent). :smile:

@Lyle: The actual processing part can be ported to a PS plugin (and it is even easier using my bridge). The problem is that Photoshop does not have any native UI parameter controls for plugins, so it would have to be created by the developer, which is a lot of work. The G’MIC GIMP plugin uses the GTK library for its UI controls, that however is (as far as I know) not compatible for the Microsoft compilers that are required by the Photoshop SDK, so you can’t use the same technology there.

Sad for PS users then. lolol

:slight_smile:

Why sad ? They can download GIMP and install the G’MIC plug-in. All is free, they just can do that :smile:

2 Likes

Yes, David is right, GIMP already surpasses PS in some areas in my opinion and it is free and open-source, so no reason not to use it.
As for Photoshop, their plugin SDK is in need of a serious overhaul anyway, but that may just be my opinion :slight_smile:

Of course you are right David/Tobias. I just know they won’t. lol

:slight_smile:

So in this case, I suppose that’s not the kind of users I’d like to deal with. Great news! :wink:

Yes; they can be hard-headed, but not all of them are bad David. :slight_smile:

I am making lots of progress on the Adobe plugins as well as the OpenFX plugins for G’MIC!
Here is what you can look forward to in the new year:
G’MIC effects working as native plugins (Adobe or OpenFX) in various hosts!
Among the supported applications:

  • The Foundry Nuke
  • Natron
  • Blackmagic DaVinci Resolve
  • Sony Vegas Pro
  • Adobe After Effects
  • Adobe Premiere Pro
  • etc. etc.

3 Likes

Hey Tobias that looks like a really great thing to try. Congrats!
Where can I get the OpenFX plug in for Natron from?

Hi Mondayman,
the OpenFX plugins are not yet released. I was hoping to put them out by the end of January 2016, but as usual, real life got in the way. If you are on Windows, I could provide you with a test build in the next week or so, for Linux I need to update my makefiles first.

Sorry, I only got Linux (Ubuntu).

But its ok. Take all the time you need.
And thanks for your effort Tobias. This will be really great, I am sure.

Just out of curiosity, will the effects take long to compute in a natron projekt?
I mean could it make Natron to an After Effects motion graphics competitor?

I hope I have a public test version for Ubuntu available shortly. At the moment, it is a little bit tricky to copy each file into the right location, I want to sort this out first to make it a bit more user friendly.
As for your other question: the OFX plugin is simply a bridge to native G’MIC, so the actual processing time is the same from Natron as it would be if you feed that data as a still frame into the G’MIC command line interface. There is a bit of overhead for converting back and forth the pixel data from Natron into a format that G’MIC can understand, but this is a constant factor directly dependent on the image dimensions.
I also have an implementation of G’MIC as an After Effects plugin, as you know. Actually they both use the same internal code, just the wrapper interface around them is adapted to the host.
many of the algorithms in G’MIC are not usable in realtime (like many other complex effects in video applications), but perform quite well in those hosts nevertheless.

Ah ok, thanks for the explaination Tobias.

I dont want to steal your time, because you have a things to do ;),
but apropo G’MIC and realtime, have you heard about ZArt and could it be usable in any way for faster processing with G’MIC/Natron?

It is from David Tschumperlé the main author of G’MIC and it uses the G’MIC image processing library.

I’ve made this video, but of course I haven’t used the full-res movie for the demonstration, otherwise it wouldn’t have run this fast. I believe the preview should be always done on a thumbnail with a reduced size (either a crop, or a downscaled version of the full-size image), just as it’s done in the GIMP plug-in.
I don’t know if this is easily possible in a OFX plug-in though.

Ah ok, thanks David.
It was just an idea.