Support for blending mode "source" for making "holes"

Bug #587579 reported by joachimeibl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Wishlist
Unassigned

Bug Description

Hi,
My problem is this: I want to make "holes" into an imported bitmap image, so that I can see through to what is below that image.
I can't figure a way to achieve this with currently available possibilities.
I would suggest a blending mode "source" on individual objects.
(Comparable to composition-mode "Source" from QPainter: http://doc.qt.nokia.com/4.6/qpainter.html#CompositionMode-enum)

Currently creating an object with an alpha value allows transparency to the object below. But it does not make a hole into that object because the "normal" blending imitates a real transparent object.

The mode "source" on an object would take the complete RGBA from a pixel and apply it only in the same layer. So if that object is on top in that layer, the alpha value would define how that layer is transparent at that position, regardless, what objects are below. This would be like erasing the objects below in that layer.

Best regards, (you're doing a great job!)
Joachim

su_v (suv-lp)
tags: added: filters-svg
Revision history for this message
ScislaC (scislac) wrote :

Have you tried using a clippath or mask to achieve what you're looking for?

Revision history for this message
su_v (suv-lp) wrote :

If the solution is not based on SVG filters -> see
Bug #412928 “Allow clip/mask set inverse”:
<https://bugs.launchpad.net/inkscape/+bug/412928>

'Inverse clip/mask' with currently available tools:
a) as clip path:
draw a rectangle/object covering your image, subtract a second rectangle/object with size/location of the intended 'hole' and use the result as clip-path.
b) as mask:
draw a solid white rectangle/object covering your image, a black rectangle/object with the size/location of the intended 'hole', group the white and black object and use the group to mask your image.

tags: added: clipping
Revision history for this message
su_v (suv-lp) wrote :

… and an example using SVG filters (feImage and feComposite). Enter the group in the top layer and move the (apparently transparent) star.

Note: Firefox 3.5.9 and Safai 4.0.5 don't display the filter effect (feImage), but Squiggle (Batik 1.7) and Opera 10.53 do.

References:
- Inkscape Filter Effects - Compositing Filter Primitives
  <http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Filters-Compositing.html#Filters-Composite>
- SVG 1.1 Specification - 15.12 Filter primitive 'feComposite'
  <http://www.w3.org/TR/SVG11/filters.html#feComposite>
- Example 10-7. Use of feComposite in and out (uses the in and out operators to do "cut-outs.")
  <http://commons.oreilly.com/wiki/index.php/SVG_Essentials/Filters#svgess-CHP-10-EX-7>

Revision history for this message
joachimeibl (joachim-eibl) wrote :

Thank you very much for the many examples and references. I didn't know about masks in inkscape/svg. This helped me a lot!
Joachim

jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
Rob Antonishen (rob-antonishen) wrote :

https://bugs.launchpad.net/inkscape/+bug/587579/+attachment/1410738/+files/cut-filter-3.svg

No longer seems to work in the current development builds? Has fecomposite been broken?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.