Blend Mode Darken problem (Ghost offsets)

Post questions on how to use or achieve an effect in Inkscape.
Jonathan Francoeur
Posts: 19
Joined: Tue Jan 31, 2012 5:29 am

Blend Mode Darken problem (Ghost offsets)

Postby Jonathan Francoeur » Sat Feb 18, 2012 4:42 pm

I'm making a solar map by creating layers of shadows. Where the shadows overlap it is darker.
My goal is that:
When there are 6 overlapping layers the colour is 100% black(RGBA000000ff). R,G&B=0 A=255
When there are 5 overlapping layers the colour is 100% black(RGBA000000cc). R,G&B=0 A=204
When there are 4 overlapping layers the colour is 100% black(RGBA00000099). R,G&B=0 A=153
When there are 3 overlapping layers the colour is 100% black(RGBA00000066). R,G&B=0 A=102
When there are 2 overlapping layers the colour is 100% black(RGBA00000033). R,G&B=0 A=51
When there are 1 layer of shadow the colour is 20%Black (RGBA00000033) R,G&B=0 A=0

My issue is that these are the colours that I'm getting when they overap:
A) (see and example SVG Image)
When there are 6 overlapping layers the colour is 100% black(RGBA000000ff). R,G&B=0 A=255
When there are 5 overlapping layers the colour is 100% black(RGBA000000cc). R,G&B=0 A=204
When there are 4 overlapping layers the colour is 100% black(RGBA00000099). R,G&B=0 A=153
When there are 3 overlapping layers the colour is 100% black(RGBA00000066). R,G&B=0 A=102
When there are 2 overlapping layers the colour is 100% black(RGBA00000033). R,G&B=0 A=51
When there are 1 layer of shadow the colour is 20%Black (RGBA00000033) R,G&B=0 A=0
opacity for each layer is set at 20% (I choses 20% because 100/5 is 20)
opacity for each (shadow) set at 0
Colour for each (shadow) set at 0RGBA000000ff
Blend Mode Normal
B) (see and example SVG Image) (PNG file Image)
My best luck has been changing blend mode to darken and opacity of objects to 20% with opacity of layer to 100% and my problem is these ghost rectangles that mess things up. I also notice that in previewing my post the shadows in B don't show.
Any ideas?
I've tried from Ubuntu 10.04 and Windows 7 with the same results. I'm using a Dell Dimension 8250

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Blend Mode Darken problem (Ghost offsets)

Postby ~suv » Sat Feb 18, 2012 11:10 pm

Jonathan Francoeur wrote:(…) and my problem is these ghost rectangles that mess things up.
Those are not ghost rectangles of offsets, but overlapping areas of the default filter effects region (which is larger than the object bounding box) - AFAIU the known limitation of the double-counting background as described in the Inkscape manual section for blend modes: Double counting background

Workaround: add a bottom layer with page-sized rectangle using a solid white fill.
Shadows2+solid_background.svg
(21.68 KiB) Downloaded 211 times

Jonathan Francoeur wrote:I also notice that in previewing my post the shadows in B don't show.
AFAICT that's due to most web browsers not fully supporting certain compositing filter effect in SVG files.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Blend Mode Darken problem (Ghost offsets)

Postby ~suv » Sat Feb 18, 2012 11:27 pm

Alternative workaround to avoid the (visually distracting) 'ghost rectangles':
Reduce the filter effects region for each of the layer blend filters (in 'Filters > Filter Editor > Filter General Settings') to
  • Coordinates: X=Y=0.00
  • Dimensions: Width=Height=1.00
Shadows2-fitting-FER.svg
(22.27 KiB) Downloaded 229 times

Note: the resulting image differs from the first workaround (adding a solid filled object in the background).

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Blend Mode Darken problem (Ghost offsets)

Postby ~suv » Sat Feb 18, 2012 11:50 pm

The formulas used for the (layer) blend modes (RGB and opacity) can be found in the SVG 1.1 specification for the feBlend filter primitive.

Jonathan Francoeur
Posts: 19
Joined: Tue Jan 31, 2012 5:29 am

[Solved] Re: Blend Mode Darken problem (Ghost offsets)

Postby Jonathan Francoeur » Sun Feb 19, 2012 2:34 pm

Thank you ~suv.
Your alternative workaround created the results I was looking for. Thank you for editing the SVG files and posting them so that I could see which work around did the trick this made it much easaier for me to choose a solution.
The first one while removing the "ghost offsets" yielded the same results as what we see in my first SVG (not enough contrast between shades).
The Second one yields exactly what I wanted.

Jonathan Francoeur
Posts: 19
Joined: Tue Jan 31, 2012 5:29 am

Re: Blend Mode Darken problem (Ghost offsets)

Postby Jonathan Francoeur » Sun Feb 19, 2012 4:57 pm

Thank you very much for your reply. Your alternative method worked very well of my application using rectangles.
To further complicate things I would also like to achieve the same results using other polygones and circles.
Unfortunately the fix for rectangles does not work the same for circles. I'm sorry that I didn't use circles or polygones in my first post.
While we were able to achieve the desired results using rectangles, here is what it looks like with circles.
Image
here is the svg file
SVG Image
Thanks again.

User avatar
RobA
Posts: 335
Joined: Fri Aug 10, 2007 1:22 am

Re: Blend Mode Darken problem (Ghost offsets)

Postby RobA » Mon Feb 20, 2012 6:12 am

I just wanted to jump in and let you know that what you are trying to do will not work.

Opacity is not additive the way you are thinking. If you have two black objects each at 50% opacity and overlap them, you do not get 100% opacity.

You have to think in terms of transmission. A 50% opacity lets though 50% of what is below it. SO if you stack a 50% opacity black object over another you will allow 50% of 50% of what is below it show through, or 25%. Which is the same as one black object at 75% opacity.

-Rob A>

Jonathan Francoeur
Posts: 19
Joined: Tue Jan 31, 2012 5:29 am

Re: Blend Mode Darken problem (Ghost offsets)

Postby Jonathan Francoeur » Sat Mar 31, 2012 8:42 am

I've created a topic asking for help in wording this problem as a feature for submission to Launch Pad. http://www.inkscapeforum.com/viewtopic.php?f=28&t=11811#p43473

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Blend Mode Darken problem (Ghost offsets)

Postby brynn » Sat Mar 31, 2012 10:45 am

So as not to clutter the other topic, in case there is a way to do what you want, I decided to comment here. But my comment is that it might not be possible. There's a fundamental difference in the way that colors are printed and they way they are rendered on a computer screen. I've read about this, but only vaguely understand it. It has something to do with how our eyes work. And also, as you've learned in this topic, part of the problem (apparently) lies with the SVG standard. At the very least, it sounds to me like you'll have to wait for that to be corrected, and then for Inkscape to be brought into compliance with it. But as I've said, I don't have a very strong understanding of these things, and I'll leave it for those more knowledgeable :D

Jonathan Francoeur
Posts: 19
Joined: Tue Jan 31, 2012 5:29 am

Re: Blend Mode Darken problem (Ghost offsets)

Postby Jonathan Francoeur » Tue Oct 09, 2012 6:57 am

THank you brynn. I hope that someone more knowledgeable somewhere some day will be able to figure this one out because solar maps are so great to have when planning for growing plants.


Return to “Help with using Inkscape”

Who is online

Users browsing this forum: No registered users and 9 guests