[CinCV TNG] About GREYCstoration plugin

Nicola Ferralis feranick at hotmail.com
Fri Apr 24 22:33:33 CEST 2015

Just some clarifications here. The plugin as submitted as a patch is 
composed by two parts. The CImg library (with the generic greCstoration 
header) and the actual cinelerra binding components that makes the 
library work within cinelerra.

David Tschumperlé is the developer of the former. The bindings to 
cinelerra where developed by someone else, and are as of now in the 
public domain (as per verbal agreement with the original author, waiting 

Having said this, here some comments on the CImg library. It is very 
true that CImg has evolved and a new library was developed to replace 
greyCstoration. However the replacement that is in place is designed to 
provide new additional capabilities for still image processing. 
Essentially, the new library is definitively a lot broader in scope than 
the original greyCstoration. But if we look at the part that concerns 
what the cinelerra plugin actually uses (the anisotropic blur function) 
that is exactly the same in the new CImg library, with changed APIs and 
broken backward compatibility. In terms of speed, and capabilities, if 
you try the old and new one on still images it's the same.

So rewriting a more comprehensive plugin based on the new CImg library 
is certainly possible, but wouldn't provide any benefit to what it can 
do now, other than additional processing capabilities. The trade off is 
that a new plugin needs to be written from scratch.

As the current one works as intended and provides the benefit of the 
user now, I feel we should stick to it. If someone has time to write a 
new one that adds to what the current one can already do that's great. 
But don't expect any improvement to what a new library can do to the 
current capabilities.


On 4/24/15 4:17 PM, igor_ubuntu wrote:
> Hi, guys !
> Today I contacted the author of this plugin
> David Tschumperlé
> David.Tschumperle at ensicaen.fr <mailto:David.Tschumperle at ensicaen.fr>
> and received a reply. I quote here the full answer here. My English
> istoo poor to lead further correspondence, but I hope that you will
> continue it.
> David offers some very interesting things.
> ===============================
> ================================
> Hello Igor,
> I guess I have to write a quite detailed answer to your question :)
> First, I'm really glad to learn you have the idea of having a plug-in
> for Cinelerra that does Anisotropic Diffusion. That is definitely a
> great idea!
> I've always thought this kind of smoothing algorithm can be useful for
> video processing.
> From my point of view, anyway, trying to write the plug-in code based on
> my (old) GREYCstoration implementation is probably not the best thing to
> do. Here's why:
> Basically, the GREYCstoration code is an *old* code, and I don't
> maintain it anymore (I mean, it's really outdated and I guess nobody
> maintains it anymore).
> I have even stopped distributing the GREYCstoration plug-in in the
> latest releases of the CImg Library, for a while, mainly because the
> GREYCstoration algorithm is now directly integrated into the CImg core
> instead.
> Indeed, I've done a lot of improvements to the anisotropic smoothing
> code (now implemented as the method CImg<T>::blur_anisotropic()) used by
> GREYCstoration.
> One of the major improvement I did is that I've parallelized the code
> (using OpenMP directives) so that it really uses all the available
> processors and does perform really faster now if you
> have multiple cores (like x16 times faster on my 24-cores machine).
> I've also done a lot of improvement to the whole code of the CImg
> Library, including important fixes (on wrong memory access for
> instance), doing a lot of sessions of valgrind / gprof and so on,
> to make the code faster and cleaner. So, I don't know what version of
> CImg you are using, but if it has any mention to the GREYCstoration
> plug-in in it, it is probably quite old,
> and personally I wouldn't use it :) Current version of CImg is numbered
> 1.6.2 or 1.6.3_pre.
> In my opinion, you have then the risk of having to backport a lot of
> changes I've already done on the CImg code, to get a plug-in that works
> well without any flaws (and still not parallelized),
> if you use my old GREYCstoration code. It's like having to do the
> debugging work again. It is probably a waste of time.
> What I suggest then would be to completely get rid out of the
> GREYCstoration code, and just use the latest CImg file instead. It has
> the updated algorithm in it, with the method
> CImg<T>::blur_anisotropic(). The parameters are basically the same, and
> I can ensure that this code is at least maintained. I can also probably
> help if you want a simple template code that illustrates how to use this
> method.
> Anyway, what could be even greater is this : Since 2008, I'm developing
> a new image processing framework, called G'MIC (http://gmic.eu). It
> includes a C++ library (libgmic) and it is of course based on CImg. The
> interesting fact for you is that G'MIC includes *a lot* of image
> processing operators and filters. And it is not really harder to use
> than CImg itself. So, if by chance you write a plug-in that does the
> interface between Cinerrala and G'MIC (instead of calling the CImg
> method for anisotropic diffusion directly), you will have access to more
> than 400 different filters and effects that can be applied on your
> images, and all that with the same piece of code. I've done a G'MIC
> plug-in for GIMP that works quite well (see http://gmic.eu/gimp.shtml
> for some screenshots of available effects) and it has already hundred of
> effects available, all using the same small library libgmic (which takes
> only approx. 5Mb, which is nothing). We have also set up a web service
> G'MIC Online (http://gmicol.greyc.fr) that you can try to apply
> G'MIC-based effect on your own images (GREYCstoration algorithm is
> available with the filter 'Repair / Smooth [anisotropic]').
> Here is a link to a very small piece of code that shows how to invoke
> the 'libgmic' library in C++: http://pastebin.com/6zQb943y
> The libgmic API is fully compatible with the CImg structures, so I think
> it is very simple to use. If you have already some piece of code that
> makes the interface with CImg, you're almost done with G'MIC as well.
> And of course, G'MIC integrates the GREYCstoration algorithm, but as I
> said, also much much more other filters, for denoising (lot of different
> smoothing filters to be honest), sharpening, general filtering, doing
> artistic effects, film simulation, 3d rendering, color transfer,
> inpainting, and so on... Look at the G'MIC Online website to get an
> overview of some of the filters running from.
> I'm sure most of these filters could be nice to have for a video editor.
> G'MIC is now the main project I am working it, and I'm adding new
> filters regularly, so any plug-in based on libgmic can also get these
> new filters. For you, it would mean having new filters without much new
> code to write. That could be really great!
> I'm confident G'MIC can be used for video processing. We have already
> made ZArt, a small qt-based software (which uses libgmic) that shows how
> G'MIC can perform on real-time video processing, see this live video :
> https://www.youtube.com/watch?v=k1l3RdvwHeM
> Honestly, I think that being able to run G'MIC filters on other video
> editors could be awesome, not only for the GREYCstoration algorithm but
> also for all the other effects it proposes.
> I'm open for discussions about this, so don't hesitate to ask questions
> if you have any.
> Best Regards,
> David.
> ========================
> Igor

More information about the Cinelerra mailing list