[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: Add filter plugin
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2012-08-03 10:52:33
Message-ID: alpine.LNX.2.00.1208031244020.27305 () calcifer ! valdyas ! org
[Download RAW message or body]

On Fri, 3 Aug 2012, Daniel Johannsen wrote:

> Hi Krita development team,
> 
> i like to add a new filter plugin into Krita. Basically, it is a desaturation \
> filter which preserves luminance information when converting from rgb to grayscale. \
> The algorithm constists of a simple linear combination of the rgb values in order \
> to derive the gray value. 
> As a quick (and dirty) feasibility study, i altered the source file \
> LcmsColorSpace.h by overwriting the method call 
> cmsDoTransform(cmstransform, const_cast<quint8 *>(src), dst, nPixels);
> 
> inside the method transform in struct KoLcmsColorTransformation.
> 
> While this works and changes the color of the image in the way it supposed to, of \
> course it is far from being an incorporation of a new filter plugin into Krita.
> 
> Now,
> how do i add a new filter plugin into Krita the right way?
> Is there any documentation which explains how to write a filter plugin? (I found \
> only one Developing Krita Plugins, but it seems way out of date.)
> 

Yeah, that's very out of date... Basically, when doing a filter you have 
two choices: either you can use lcms' color transformations. That is 
mostly colorspace independent. That's where you ended up in this case.

However, you can also implement the code right inside the filter plugin. 
These are in krita/plugins/filters, where you can find lots of examples. 
What you need to do then is to take the incoming pixels, convert them to a 
known colorspace (like Lab, for instance), do the algorithm, then convert 
it back.

Basically, all you then need to do is implement the process() method.

Boudewijn
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic