This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Apparent vector shape masking/clipping: How does it work?

Tags: None
(comma "," separated)
ahabgreybeard
Registered Member
Posts
1269
Karma
11
OS
I've noticed something about the Vector Library items that I can't understand and I hope that someone can explain it to me.

The items in the Brush Preset Icon Library section have many well made icons that seem to use some kind of masking/clipping as part of their structure and design. I can't figure out how this works.

As an example, you can try the Kneadable Eraser Preset Icon, the third one down from the top, because it's small and simple.

If you Ungroup it, you can move the two black outline shapes away and delete them since they seem to be just additions to a lower level group. The lower level group is three vector shapes, dark grey, mid grey and pale grey in colour.

If you Ungroup this and then use the Edit Shapes Tool, you can see that the dark grey shape is a rectangle, the other two are vector path shapes and all of them seem to be masked/clipped somehow.

If you then use the Select Shapes Tool to select and slightly move any of these shapes, the masking/clipping effect disappears and you see all three complete shapes. I've tried selecting all three and Grouping them but the masking/clipping effect does not return. The only was to get it back is to use the Edit -> Undo to work back to undo the initial Ungroup action.

I've made a video of this here: https://www.dropbox.com/s/ygntiibdinywv ... r.mp4?dl=0

If I Copy the initial full item and then paste it to Inkscape, it loses the masking/clipping in Inkscape. I mention this as a matter of interest. I'm wondering how krita does this.
User avatar
Quiralta
Registered Member
Posts
301
Karma
5
OS
Hey ahabgreybeard, A quick look into the symbol library opened in Inkscape shows that that specific icon has indeed masking on the shape as it is a rectangle and not a the polygon you will expect, also by the look of it Krita is not "translating" the blur effect on the highlights either.

The funny part is that it happen to be only this icon that it has a mask (I may be wrong though) :D


Self educated by a very bad teacher!
My Stuff
ahabgreybeard
Registered Member
Posts
1269
Karma
11
OS
Hi Qiralta, Thank you for mentioning opening the symbol library in Inkscape. I found the symbol library (eventually) and opened it to have a look.

Actually, the inking_brush_preset_icon (below the Kneadable Eraser) also has the masking/clipping effect in use on the tip as you'd see if you did a few levels of Ungrouping and dismantling. Those may be the only two that do though.

I exported the eraser out of Inkscape as a .svg file and then opened it in krita and it displayed the blurring due to the use of Gaussian filters specified in the .svg file. This may have been supressed by the krita library code, who knows?

The clipping is due to a clip path specification that is defined and then applied to the group content definition.

It seems that krita will maintain and display some of the .svg specifications but does not provide the facility to create them all. This is to be expected because .svg can do all sorts of complicated things. So, the mystery is solved and I'd need to use Inkscape to do complicated stuff :)
User avatar
Quiralta
Registered Member
Posts
301
Karma
5
OS
Ah, very interesting work through, Yeah I didn't ungroup the file, just a quick opening and looking through it, simply wanted to see (curious here too) how the preset icons where storage on file as I didn't remember ever seeing them on their own in the sources. On Inkscape you can unmask/unclip before ungroping, may give even better "dissection" of the file. Any way glad you figure it out and thanks for sharing the results. :)


Self educated by a very bad teacher!
My Stuff


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]