Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce generated SVG file size #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Reduce generated SVG file size #63

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 17, 2017

Since this project takes alpha from a global config, all shapes share the same opacity.

Giving alpha to the parent element, reduces size of generated SVG by 31% for n=100

@css117
Copy link

css117 commented Nov 18, 2017

Alpha on single shapes won't output same as group alpha
opacity-per-element-or-per-group

@davethegr8
Copy link

davethegr8 commented Jan 16, 2018

Instead, use a style tag as a child of the svg and it'd be a fine replacement. Example:

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="480" viewbox="0 0 4096 3072">
        <style>polygon { fill-opacity: 0.5; }</style>
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants