Blur-feather-& beyond

General discussions about Inkscape.
User avatar
David Hewitt
Posts: 142
Joined: Sun Jan 11, 2009 4:10 pm

Blur-feather-& beyond

Postby David Hewitt » Tue Feb 17, 2009 11:51 am

I was just investigating the blur and feather options in xara with a view of gaining some understanding of these different effects through experimentation.
Mainly because I was thinking that inkscape could benefit from having a generic blur slider on the UI (as xara does)...
But i thought i would investigate this a little more in depth as i dont see any reason why inkscape should necessarily limit itself to some limitations that are apparent in the xara model....

In xara there is a feather box (with dropdown slider) on the UI (top toolbar) that is there at all times.
This is not active when an object is not selected but can be applied to selected objects....
This particular effect called FEATHER in xara is adjustable from 0-50 pixels....
The effect of this tool creates a blur (exactly the same effect as the gaussian blur effect) that is 100% inside the outline of the created shape.

I did some experiments with large primary red squares on white back grounds with no outlines (display always at 100% zoom) measuring from screen grabs the exact extent of the effect (ie from where the white (255 255 255) ended to where the pure red (255 0 0) in the center began I.e to determine how many pixels wide the actual effect was.... and how this related to the original outline....

im happy to report that with the feather tool in xara everything was a is expected...
All blur is always (on its most outer extent) kept with-in the confines of the original object outline and radiates inward by exactly the right amount of pixels defined in the FEATHER Setting....

Why would i bother testing this
Well i wanted to compare this to the gaussian blur to see the difference and to understand this feather slider in this broader context (as inkscape does not have one currently and as i was planning to suggest one i wanted to understand exactly what the xara one is doing...)

Anyway i went on to the gaussian blurr setting and done some similar tests.....

At 96dpi with large square primary red object on a white background i noted the following data (in the table)....

pixel extent= the length of the blured section in pixels and then the next to fields show how much of this area appeared inside the original object outline and how much bled out of it.....

You will not some small deviations as to the ratio of the blur that actually excape the outline and that component of the blur that is contained with-in it.... for different amounts of blur....but that the blur extent for gaussian blur basically sits 50% inside and 50% outside the original object (with only a small deviation from this).
Also the higher the resolution the less this discrepancy seems to be apparent...
(in my first test on a large red circle showed a blur extent of 225 pixels 80 being outside and 145 being inside! which did trouble me a little....)
Anyway basically the blur extent being 50/50 internal/external seems to hold true.....(with slightly more tending to be internal as one approaches 100 (max blur)


Blur - dpi - Pixel extent - Intenal pixels - external pixels
-------------------------------------------------------------------------------
100-----96----183---------------83---------------101
--50-----96-----93---------------41---------------52
--25-----96-----41---------------21---------------20
100-----150----104---------------52---------------52
--50----150-----58---------------32---------------26
--25----150-----27---------------14---------------13
100----200-----84---------------37---------------47
--50----200-----45---------------21---------------24
100----300-----58---------------26---------------32
--50----300-----28-----14-----15
-------------------------------------------------------------------------------
It is my assumption that the intention of gaussian blur is to have an equal amout of blur inside as outside the object outline...I.E that the blur zone sits on the outline...

Another interesting thing from this data is that as the resolution setting of the effect is increased the visible blur decreases...
Which was not what i expected to happen....

It would make far more sense if this resolution setting did not effect the blur extent..
I.E that changhing the render resolution should not effect the blur extent but rather only resolution that this would actually be....
IE like 2 different images the same size but with different resolutions.....
The current model in xara alters the size of the blur (image) when the resolution is changed...
Which is a blunder....

anyway sorry to bore you folk... im just doing some preliminaries as a will propose a blur slider for inkscape shortly...
Any ideas or comments are welcome

SureWhyNot
Posts: 137
Joined: Mon Jun 16, 2008 11:37 pm
Location: United States

Re: Blur-feather-& beyond

Postby SureWhyNot » Tue Feb 17, 2009 12:22 pm

David Hewitt wrote:Mainly because I was thinking that inkscape could benefit from having a generic blur slider on the UI (as xara does)...


There's one in the Fill and Stroke Dialog (Shift+Ctrl+F)

To keep the blur inside a set radius, duplicate the object you want to blur and use it for clipping.

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Blur-feather-& beyond

Postby microUgly » Tue Feb 17, 2009 12:27 pm

I think you have the wrong idea about the difference between blur and feather.
Image
Image
The left image is the effect of a blur, the right image is the effect of a feather. You might like to check if this is what Xara does when your object is not a flat colour.

User avatar
David Hewitt
Posts: 142
Joined: Sun Jan 11, 2009 4:10 pm

Re: Blur-feather-& beyond

Postby David Hewitt » Tue Feb 17, 2009 4:01 pm

Thats helpful..thanks...
How do you feather in inkscape?

Select an object-Hold [F]-& drag the object handles in to control the amount of feathering?LOL (sounds good to me)

I guess it is technically possible to emulate that as already said by placing an un-blurred copy on top to mask out the middle of the object and reducing this down with the [Ctl] [(] function until it neatly hides the middle...
Like a total eclipse of the sun where the sun's corona is laid bare ETC....(what nice mental imagery :) )
Then reducing the whole thing until it neatly fits in-side the exact same outline with no bleeding....
I.E as blur obviously extends beyond the outline where as feathering is completely with-in it..

Allot more involved than it first appears...



Anyway obviously this is a bit fiddly (to do properly)....

There must be existing requests for this feature to be automated and rolled out similar to what xara has done.....

And while were at it why is there no icon for [ctrl] [(] ETC like click on this icon and drag out the contour with object handles ETC.... on-screen?

There is a few features like this currently in inkscape that are already done (functionally) but just need the extra UI polish to finish them off....

Another example is filters; i was very impressed when i saw how you could compose and stack filters ETC...
But there is no simple way of doing it......(again xara's "live effects tool" is a model to examine....not perfect but simpler)
Not to replace what currently exists of course.

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Blur-feather-& beyond

Postby kelan » Wed Feb 18, 2009 2:21 am

You can't do accurate feathers in Inkscape except on circles, or by spending a ton of time. That's because you have to use a mask with a gradient that follows the outline of the shape. It's an often requested feature, but Inkscape can't do it yet, as far as I know. (Because SVG doesn't support it, Inkscape would need its own work around implementation, like it has with 3D boxes.)

To feather a circle, duplicate it, then add a radial gradient to the duplicate, with black at the edge and white in the center. Then mask the original circle.

Doing any other shape, you can get varying degrees of success using the Interpolate effect under Effects > Generate from Path. Use a black duplicate of the original, and a white duplicate that has been made small. Interpolate between them, including style, and it will create a bunch of inbetween size gray objects. Group the new objects with the black and white, and then use as a mask. You don't get a smooth fading, though, unless you use a very high number of interpolation steps.

Honestly, I don't really see how the devs can fake a "gradient that follows the shape outline" in a practical way. I guess they don't either, or it probably would have been done by now.

User avatar
EarlyBlake
Posts: 302
Joined: Tue Jun 03, 2008 5:42 pm

Re: Blur-feather-& beyond

Postby EarlyBlake » Wed Feb 18, 2009 2:24 am

Can't you blur the mask before applying to get a limited feather like effect?

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Blur-feather-& beyond

Postby kelan » Wed Feb 18, 2009 3:44 am

EarlyBlake wrote:Can't you blur the mask before applying to get a limited feather like effect?

Yep, and that can help a with the banding you get from the interpolated mask.

User avatar
EarlyBlake
Posts: 302
Joined: Tue Jun 03, 2008 5:42 pm

Re: Blur-feather-& beyond

Postby EarlyBlake » Wed Feb 18, 2009 4:35 am

The whole 5 seconds of research I did on Photoshop feather said the most basic feathering was down with a Gaussian Blur. Dunno how the smart objects and hella cool/complicated contouring, clipping, etc layers in Photoshop do their thing though. How about I make my new catch phase, "But Photoshop can do to." Just Kidding. :twisted:

User avatar
prkos
Posts: 1625
Joined: Tue Nov 06, 2007 8:45 am
Location: Croatia

Re: Blur-feather-& beyond

Postby prkos » Wed Feb 18, 2009 5:22 am

In the dev version there is a built-in filter Feather, and as far as I can tell it performs as expected :)

Filters used to achieve this effect are Morphology, Gaussian blur and Composite. And as always thanks to Ivan Louette :)
just hand over the chocolate and nobody gets hurt

Inkscape Manual on Floss
Inkscape FAQ
very comprehensive Inkscape guide
Inkscape 0.48 Illustrator's Cookbook - 109 recipes to learn and explore Inkscape - with SVG examples to download

User avatar
David Hewitt
Posts: 142
Joined: Sun Jan 11, 2009 4:10 pm

Re: Blur-feather-& beyond

Postby David Hewitt » Wed Feb 18, 2009 8:52 am

Really....
I couldn't find such a filter in my dev version...
is that really new...(ie released in the last few weeks)?

Also applying filters is a confusing i think.."the standard deviation slider"?
is that to apply a filter locally to an object or globally ?
It seems to change all the objects i have with the one filter applied
do i need to create a new filter for every object in order to adjust them individually?
I must be missing something important..(like how to use itLOL)

Also when i did apply a gaussian blur to a small rectange (much wider than it is high) the resulting blur was flat on the top and bottom faces (hard stop) and but smooth on the left and right? and also the dotted bounding box ballons to a massive size?
Which does not appear to be just the extent of the blur at it is totally blank?
Also i found the rendering cluncky..very buggy...

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: Blur-feather-& beyond

Postby microUgly » Wed Feb 18, 2009 9:29 am

Off topic:
David Hewitt wrote:And while were at it why is there no icon for [ctrl] [(] ETC like click on this icon and drag out the contour with object handles ETC.... on-screen?

New topics really do deserve a new thread--it makes it easier for people searching for similar information. Anyway, it's in the Path menu. I don't know why it doesn't have it's own prominent icon. Maybe because it's not a frequently used feature--I know I never use it. The shortcut is Ctrl+J
David Hewitt wrote:Also when i did apply a gaussian blur to a small rectange (much wider than it is high) the resulting blur was flat on the top and bottom faces (hard stop)

This is a known issue. I think you can correct it by moving the object or resizing it a bit which resets the bounding box for the blur. I think you'll find more info if you search the forum or Launchpad.

User avatar
kelan
Posts: 178
Joined: Thu Sep 06, 2007 12:55 am
Location: Unicorn of Open Source
Contact:

Re: Blur-feather-& beyond

Postby kelan » Wed Feb 18, 2009 11:50 pm

David Hewitt wrote:Also applying filters is a confusing i think.."the standard deviation slider"?
is that to apply a filter locally to an object or globally ?
It seems to change all the objects i have with the one filter applied
do i need to create a new filter for every object in order to adjust them individually?
I must be missing something important..(like how to use itLOL)


Filters are not part of the shape they're applied to, they're fully separate entities. A shape merely refers to which filter should be used to render it. So yes, if the same filter is applied to a bunch of objects and you adjust it, it will change all affected objects.

ivan louette
Posts: 215
Joined: Thu Aug 21, 2008 4:08 am
Location: Belgium

Re: Blur-feather-& beyond

Postby ivan louette » Fri Feb 20, 2009 6:22 am

prkos wrote:In the dev version there is a built-in filter Feather, and as far as I can tell it performs as expected :)

Filters used to achieve this effect are Morphology, Gaussian blur and Composite. And as always thanks to Ivan Louette :)


Thanks ;-}

Some times ago I replaced the previous "Feather" effect with another one which uses only Gaussian blur and Composite. Morphology did crop the angles and that's not what is expected. in fact I use Morphology in my own filters only to work on pixels (like in Pixel smear) and not on shapes outlines where it is much less interesting and needs too much system ressources.

By the way I also introduced a Blur content filter which blurs what is inside shapes without blurring the outline.

And I also splitted Xara's Feather in two different functions : the second one is called Smooth edges and correspond to Xara's feather profile set to zero pixel dispersion.

These two extremes are the most often used. But of course it could be possible to obtain intermediates with some more Color matrix for example.

By the way I did the same with blur which has its zero pixel dispersion setting called Crossmooth.

ivan

User avatar
David Hewitt
Posts: 142
Joined: Sun Jan 11, 2009 4:10 pm

Re: Blur-feather-& beyond

Postby David Hewitt » Fri Feb 20, 2009 9:29 am

hey. ivan... (is there a link to see examples of all your filters..some of them are wild....)
(it seems your "the filter guy"...)
What (if you don't mind me asking) is your opinion on this:
http://wiki.inkscape.org/wiki/index.php/User_talk:Davidhewitt#New_Inkscape_.22Contour_FX.22_Icon_.26_tool_bar...
Especially the last part relating to Feathering...

I realize your focus is more specifically the development of the filters themselves ETC...
But im unsure what technical issues may be involved in making such changes (iE im not sure how much is simply UI stuff and how much is actually filter stuff...your department) and im sure you would have opinions about how your filters or filters in general could be best applied UI wise...

obviously not all filters should have on-screen GUI but i do think allot more development of GUI approaches in inkscape equaling or surpassing some of the GUI approaches in xara would go along way to making inkscape superior to xara in nearly every way.


But "a penny for your thoughts" after reading that proposal...(if your inclined to read it...i know you must be busy....but if you do..)
(specifically with respect to the last point re: feathering GUI)(P.s. forgive the incorrrect use of the word blurr)
Thanks in advance....

- - - - - - - - - - - -
Circular and Elliptical blur FX
Also for elliptical and circular blur effects....
I would like to see a system similar to what xara has (for the GUI)...(im aware your up on xara)
But with the following additional functionality :

1) The ability to control the outer +INNER extent of the "graduation ring/ellipse" i.e to control the area of the middle which is un-effected....

2) To have control the basic "profile" of the blend via a new GUI method. (holding [shift] would bring up a "Mid-point" node. which could be dragged in or out to position the mid point of the gradient)

3) Also the ability to add in nodes along the gradiation, which would by default be the colour/transparency ETC of this gradient at this given point and you could drag these in and out to alter the nature of the transition ETC and/or you could edit this colours of these also to have the gradient change colour one or several times as it progressed along by changing the colours of these added nodes.

How do these filter UI proposals things sit with you technically?

Q. Do you think the ability to control the inner and outer extent of the feather and radial blurs ETC and or the other changes above are things that could be made to work with existing filters with some UI upgrades ETC?


Q. Or (for these to work) would someone like yourself first need to modify the underlying filters themselves in order to facilitate this?

I.E as if you liked this idea having you on board would be awesome.

ivan louette
Posts: 215
Joined: Thu Aug 21, 2008 4:08 am
Location: Belgium

Re: Blur-feather-& beyond

Postby ivan louette » Sat Feb 21, 2009 1:57 am

You said it ! At the moment I am focusing on filters themselves and not on ui. Most of these effects will be better scaled soon to be more directly usable for web design. All what I am doing with filters I learned it by myself, browsing documentation on the web, making lots of trials and errors. Afterwards I will do my best to document all these filters before 0.47 release because it's important for me to give to the user (if he wants it) the power to improve what I have done and to create himself. But the power isn't in the ui. It's in the user willingness.

I love Xara and I love Inkscape. They have two different philosophies and for me (bio)diversity is a fundamental thing. Equalling or surpassing something has no sense for me. I am confident that Inkscape ui will evolve nicely with maturation and sure your ideas are interesting and some of them could be integrated. But as I am not a programmer I couldn't say anything about the difficulties to implement them. The only thing I can say is that in free open source software the development and the ideas aren't driven by simple imitation nor they are limited by the commercial opportunities and needs. Their only limits are the developers personal limits (willingness, technical competence, imagination, time, energy, personal tastes...). I was frustrated many years ago because the lots of ideas I had weren't considered by some software developers. Then I decided to overpass my frustration and to do what I can do with my own technical skills and imagination. In Xara that became my brushes and my mini-tutorials, and in Inkscape that becomes my filters.

Sorry, because of my native claustrophobia I wouldn't being on board anywhere ;) . My only goal is to be useful while participating to an open project and not belonging to any team. Teams are always too offensive for me. I am not a sportsman nor a soldier. I am a world citizen before anything.

ivan


Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 6 guests