w3c / svgwg

SVG Working Group specifications
Other
711 stars 133 forks source link

Ability to cut transparent holes of any shape into embedded raster graphics; Native SVG equivalent for CSS border radius (More versatility with embedded raster graphics) #788

Open HT-7 opened 4 years ago

HT-7 commented 4 years ago

I am not sure if SVG already supports any of the points mentioned here, but InkScape (the most popular open-source vector graphics editor) has not:

(These are the ones that currently come to my mind. If I think of anything more, I will edit this post and add it.)

BigBadaboom commented 4 years ago

Native SVG equivalent for CSS border-radius

On which elements? <rect> elements have rx and ry to add rounded corners. There are not many other elements that have corners suitable for border-radius.

Ability to cut transparent or transclucent holes of any shape into embedded raster graphics

There is <mask> and <clipPath>. Do they not do what you want?

HT-7 commented 4 years ago

On which elements?

Embedded raster graphics. InkScape can't do it so far, therefore I presume it is not included in the SVG standard.

InkScape does offer corner rounding for rectangles. For circles, InkScape allows setting how much of the circle is filled conically.

There is and . Do they not do what you want?

I have observed the following on InkScape. I am not sure whether these behaviours are because of the SVG standard or InkScape's own implementation:

I am not sure whether this is related to the SVG standard or whether InkScape has not fully implemented it yet.

BigBadaboom commented 4 years ago

Most vector software has the ability to perform operations on two or more paths (union, difference, etc). Those operations are intended for paths only.

If you want to cut holes in an image, you should be using clipping paths, or masks. In Inkscape, those are available via Object->Clip or Object->Mask.

fsoder commented 4 years ago

"Cutting holes in embedded raster graphics" can also be achieve by using a <pattern> fill (with an <image>) on a (sufficiently "holed") shape.

While border-radius could make sense to apply on some elements, for others they will just be a different way of applying a clip-path. I think the closest thing to border-radius we have at the moment is the inset() function to clip-path.