Too large Optimized SVG: repeated attributes

Bug #1656695 reported by carmen fierro
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

I am attaching an 'Optimized SVG' which illustrates my problem. On looking at the code, one sees that much of the size is created by repeating the attributes inside all the elementes of each <g>. My question is: could they not be given to each parent <g>, keeping in the paths, <text> and <tspan> just the information they don't share with their siblings? It would not only slim the file, but make it also more easily editable by hand, at need...
Note: I dare say, this is properly a scour issue--but, as a Windows user, I can access scour only through Inkscape.
Thanks.

=====
Inkscape 0.92 on Windows 7 64x

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

Please always include information about OS/platform and Inkscape version in the bug description when filing new reports, thank you.

Please attach the original SVG file to the bug report, to allow further investigations of the reported issue with scour.

Changed in inkscape:
status: New → Incomplete
Revision history for this message
carmen fierro (cfierrob) wrote : Re: [Bug 1656695] Re: Too large Optimized SVG: repeated attributes

Running Inkscape 0.92 on Windows 7 64x. Attached original SVG.

Carmen

2017-01-15 21:46 GMT+01:00 su_v <email address hidden>:

> Please always include information about OS/platform and Inkscape version
> in the bug description when filing new reports, thank you.
>
> Please attach the original SVG file to the bug report, to allow further
> investigations of the reported issue with scour.
>
> ** Changed in: inkscape
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1656695
>
> Title:
> Too large Optimized SVG: repeated attributes
>
> Status in Inkscape:
> Incomplete
>
> Bug description:
> I am attaching an 'Optimized SVG' which illustrates my problem. On
> looking at the code, one sees that much of the size is created by repeating
> the attributes inside all the elementes of each <g>. My question is: could
> they not be given to each parent <g>, keeping in the paths, <text> and
> <tspan> just the information they don't share with their siblings? It would
> not only slim the file, but make it also more easily editable by hand, at
> need...
> Note: I dare say, this is properly a scour issue--but, as a Windows
> user, I can access scour only through Inkscape.
> Thanks.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1656695/+subscriptions
>

su_v (suv-lp)
Changed in inkscape:
status: Incomplete → New
description: updated
Revision history for this message
Patrick Storz (ede123) wrote :

You're absolutely right that there is room for improvement and this is actually on the todo-list, see [1] for the relevant code section and the list of attributes Scour currently moves to a parent group.

The reason that they're not added yet, is that all of those attributes are pretty "non-standard" and virtually unused:
- "color" (altough it looks obvious) is not used to determine the color of an element - "fill" and "stroke" are! Only if one of those specifies the indirect value "currentColor" the value of the "color" attribute might be used (I doubt many renderers support this and I don't know of an editor which makes use of this)
- "solid-color" is an SVG 2 attribute. It's not yet standardized and not yet supported by Scour
- The style attributes "isolation" and "mix-blend-mode" are part of the yet to be released "Compositing and blending Level 1" CSS extension.
- "color-rendering" and "image-rendering" are the only ones of practical use at this time and even here I wouldn't know which renderer makes use of them and which editor can produce them.

May I ask what software you used to produce this file?

[1] https://github.com/scour-project/scour/blob/210c5f64abdf336e25c58ca927093b3aa94c0a0c/scour/scour.py#L1076

Revision history for this message
carmen fierro (cfierrob) wrote :
Download full text (3.5 KiB)

I made it with Inkscape 0.91, although I suspect myself of a very
amateurish way to achieve the result:
1. Layer with scanned image to use as pattern (is a book illustration).
2. Layer 'Squares': beginning with a single square, no fill, black stroke,
tile clones 15x1, trial-and-error to pick displacement; group and repeat
with inverse values for 1x15. Then, having forgotten about fill and stroke
left 'unset', un-link the clones, and select the squares to be filled black
and grey.
3. Layer for numbers: put by hand, extensive alignment and distribution;
font for roman numerals selected through NexusFont.
4. Layer for letters, ditto.
5. Remove the layer (1), and convert the groups by color in (2) to paths,
to slim the file--it took out some 20Kb.
I never attempted to vector the image in (1): unless I can manage a very
simple image in very few colors (i.e., a mute map as indexed PNG), the
result of converting to path, either in Inkscape or (by selection) in GIMP,
is not very much to my taste. Of course, we retired persons have time for
hobbies.
Would a slimmer result obtain from converting to vector, for instance, an
exported to PNG copy of layer (2)?
It may be worth trying...

Carmen

2017-01-15 22:46 GMT+01:00 Eduard Braun <email address hidden>:

> You're absolutely right that there is room for improvement and this is
> actually on the todo-list, see [1] for the relevant code section and the
> list of attributes Scour currently moves to a parent group.
>
> The reason that they're not added yet, is that all of those attributes are
> pretty "non-standard" and virtually unused:
> - "color" (altough it looks obvious) is not used to determine the color of
> an element - "fill" and "stroke" are! Only if one of those specifies the
> indirect value "currentColor" the value of the "color" attribute might be
> used (I doubt many renderers support this and I don't know of an editor
> which makes use of this)
> - "solid-color" is an SVG 2 attribute. It's not yet standardized and not
> yet supported by Scour
> - The style attributes "isolation" and "mix-blend-mode" are part of the
> yet to be released "Compositing and blending Level 1" CSS extension.
> - "color-rendering" and "image-rendering" are the only ones of practical
> use at this time and even here I wouldn't know which renderer makes use of
> them and which editor can produce them.
>
> May I ask what software you used to produce this file?
>
> [1] https://github.com/scour-
> project/scour/blob/210c5f64abdf336e25c58ca927093b
> 3aa94c0a0c/scour/scour.py#L1076
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1656695
>
> Title:
> Too large Optimized SVG: repeated attributes
>
> Status in Inkscape:
> New
>
> Bug description:
> I am attaching an 'Optimized SVG' which illustrates my problem. On
> looking at the code, one sees that much of the size is created by repeating
> the attributes inside all the elementes of each <g>. My question is: could
> they not be given to each parent <g>, keeping in the paths, <text> and
> <tspan> just the information they don't share with their siblings? It would
> not only slim the file, bu...

Read more...

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.