GMIC in Krita

Boudewijn Rempt boud at valdyas.org
Sat Apr 13 19:52:36 UTC 2013


On Sat, 13 Apr 2013, Lukast dev wrote:

> Hi fellas,
>
> I'm working on integrating GMIC, thanks to Silvio Grosso, into Krita
> and today I have first results applied on Ramon paintings :)
>
> Default flower and sharpen effect
> http://i.imgur.com/kYNcsNa.png
>
> Poster edges inside Krita (deevad's blog [1])
> http://i.imgur.com/XfdPxQl.png

Awesome!

>
> The examples above were created with degradation of colorspaces
> through QImage (8-bit rgba)
>
> There is a lot of work ahead so far! I will try to commit something
> this week so that you can play with it a bit,
> but so far it is pile of nasty hacks.
>
> Technical bits:
> It seems that native colorspace for GMIC is FLOAT32 RGB(A) colorspace.
>
> So my approach will be:
> a) convert layer actual color-space to FLOAT32 RGB(A), relayout pixel
> format (Krita uses bgrbgrbgrbgr, GMIC rrrrbbbbgggg)

Hm, I don't think so. Specially for float32 I created KoRgbF32Traits --
this means that the f32 and f16 colorspaces layout the pixel as rgba:

    addChannel(new KoChannelInfo(i18n("Red")  , 0 * sizeof(float), 0, 
KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, 4, QColor(255, 0, 0)));
     addChannel(new KoChannelInfo(i18n("Green"), 1 * sizeof(float), 1, 
KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, 4, QColor(0, 255, 0)));
     addChannel(new KoChannelInfo(i18n("Blue") , 2 * sizeof(float), 2, 
KoChannelInfo::COLOR, KoChannelInfo::FLOAT32, 4, QColor(0, 0, 255)));
     addChannel(new KoChannelInfo(i18n("Alpha"), 3 * sizeof(float), 3, 
KoChannelInfo::ALPHA, KoChannelInfo::FLOAT32, 4));

So not much conversion needed, I think

> b) apply GMIC,
> c) relayout back to Krita bgr format, convert back to actual colorspace
>
> More to come!
>
> [1] http://www.davidrevoy.com/article147/gmic-new-filter-poster-edges
>
> Regards,
> Lukas Tvrdy | http://lukast.mediablog.sk/log
> _______________________________________________
> Krita mailing list
> kimageshop at kde.org
> https://mail.kde.org/mailman/listinfo/kimageshop
>


More information about the kimageshop mailing list