[solved] Blurry transparency

Post questions on how to use or achieve an effect in Inkscape.
Inkscaper_

[solved] Blurry transparency

Postby Inkscaper_ » Fri Aug 29, 2008 1:09 pm

How can I make trancparency like on the right sidebar of this website http://www.hackontest.org/ ? I know I could simply blur object behind, but is there any way (filters maybe?) to do this without touching background?

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

Re: Blurry transparency

Postby kelan » Fri Aug 29, 2008 11:29 pm

Sure, no problem.

  1. First, you need to add the "enable-background" attribute to your document because we'll be using Background Image as a source in the filter. The easiest way to do this is open the Layer dialog (Shift+Ctrl+L) and change the Blend mode of any layer to something other than Normal. Then change it back to Normal. This will make Inkscape add the attribute we need to the document.
  2. Now create a new filter with the Filter Effects dialog.
  3. Add the Gaussian Blur effect, and change its source to Background Image. I'd recommend also increasing the Standard Deviation setting to something around 5 or 6 so you'll be able to see the effect. You can always change the amount of blur later.
  4. Add the Composite effect. The top input should be the output of the Gaussian Blur. The bottom input should be Source Graphic. And the Operator setting should be Atop.
The way it works is by taking whatever is below the object, blurring that, and then compositing it on top of the object itself. Note that due to the way it works, the object you put it on will need to be completely opaque. If it's at all transparent, the actual background will show through the object, in addition to the blurry background that is composited on top of it.

You could also use a simple Blend effect instead of Composite in the last step. The reason I used Composite is because if the blurring object has any holes, the Blend effect will still put a blurry part of the background inside the empty holes, but the Composite using Atop won't. So any part of the background showing through a hole will be unblurred, like it should be.

Let me know if my description of setting up the filter is confusing, and I'll post a screenshot of it.

Thanks for posting this question. I think it's a really cool effect.

Inkscaper_

Re: Blurry transparency

Postby Inkscaper_ » Sat Aug 30, 2008 2:58 am

Thanks kelan, your filter works great :]

Inkscaper_

Re: Blurry transparency

Postby Inkscaper_ » Sat Aug 30, 2008 4:59 am

Update: How can I get rid of those artefacts http://img.wklej.org/images/155922008-08-30-210621_817x583_scrot.png ? I mean horizontal unblurred lines - at first I thought it was caused by low Gaussian blur qualitty set in File -> Preferences -> Filters. But changing it to best quality didn't help. It is also visible on exported bitmaps.

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

Re: Blurry transparency

Postby microUgly » Sat Aug 30, 2008 10:01 am

Can you share your SVG file with us? If you don't have somewhere to up load it, you can use mediafire.

Inkscaper_

Re: Blurry transparency

Postby Inkscaper_ » Sat Aug 30, 2008 10:53 am


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

Re: Blurry transparency

Postby microUgly » Sat Aug 30, 2008 11:29 am

Ok, first up, this is a super sweet effect. Thanks for explaining it, Kelan.

Unfortunately what we are seeing appears to be a bug. Both Inkscape 0.46 and the recent development builds have the same problem.

You can report this bug at https://bugs.launchpad.net/inkscape. Be sure to include the SVG file for the developers convenience.

As a work around you may be able to convert the SVG to an PNG properly using Batik Rasteriser--I'm not sure what it's support for filters is like.

Another work around is instead of using this clever filter, is to select the circles group, duplicate it and apply a bur to it using the slider on the Fill and Stroke palette. Then you can use a clip to hide areas that you don't want blurred. It's not as smart, but you should be able to create the same look.

Inkscaper_

Re: Blurry transparency

Postby Inkscaper_ » Sat Aug 30, 2008 12:26 pm

This is now reported as bug #262865 on launchpad. Meanwhile I noticed that rsvg renders this filter properly, opera doesn't show it at all, haven't tried batik yet.

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

Re: Blurry transparency

Postby microUgly » Sun Aug 31, 2008 10:39 am

Off topic:
Inkscaper_ wrote:Meanwhile I noticed that rsvg renders this filter properly

I hadn't heard of rsvg before. Thanks for pointing it out.


Return to “Help with using Inkscape”