LazPaint SVG format: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: LazPaint SVG format
| Old | New | Line | |
|---|---|---|---|
| 1 | + | This is the specification of the SVG extensions used by LazPaint. | |
| 2 | + | ||
| 3 | + | ### Used terms | |
| 4 | + | ||
| 5 | + | A **layer** refers to a layer in an OpenRaster stack. They are combined together with an integer offset (x and y), a blending mode and an opacity. | |
| 6 | + | ||
| 7 | + | A **group**[1](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g) is an SVG element that contains other elements. It can apply a transform to its content. | |
| 8 | + | ||
| 9 | + | A **non trivial transform** is a transform that is not a translation of integer coordinates. | |
| 10 | + | ||
| 11 | + | ### Layer transform | |
| 12 | + | ||
| 13 | + | When LazPaint stores an SVG layer and that this layer has a non trivial transform, it put all the elements of the SVG within a group in order to make the transform part of the SVG (rotation, scaling and skew). | |
| 14 | + | ||
| 15 | + | #### transform | |
| 16 | + | ||
| 17 | + | The **transform** attribute of the group stores a transform similar to the one applied to the layer, except that it can be translated along the x and y axes. The inverse translation is specified in the x and y attribute of the layer in the OpenRaster stack, so that the resulting transform matches the one applied to the layer. | |
| 18 | + | ||
| 19 | + | There is a translation because the bounding box of the transformed SVG is generally not the same as the resulting image, in particular when it overflows the image bounds. The SVG bounds is computed to fit the transformed view box. | |
| 20 | + | ||
| 21 | + | #### bgra:originalViewBox | |
| 22 | + | ||
| 23 | + | The original view box is stored in the **bgra:originalViewBox** attribute. For example, if the SVG had its custom coordinates going from 0 to 100, it would have the value "0 0 100 100". This allows to draw a highlight rectangle when moving the SVG layer showing the current rotation even though the SVG bounds have been widened. | |
| 24 | + | ||
| 25 | + | In order for the SVG to follow the specifications, there is a **xmlns:bgra** attribute giving an URL pointing to this specification. | |
| 26 | + | ||
| 27 | + | ## See Also | |
| 28 | + | ||
| 29 | + | - [[LazPaint]] | |
| 30 | + | ||
| 31 | + | --- | |
| 32 | + | *From the Free Pascal wiki, page "LazPaint SVG format", as it stood on 2022-08-16 after a change by Skalogryz, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 33 | + | Category: LazPaint | |
| 34 | + | Category: SVG |
