[GH-ISSUE #324] SVG optimization #196

Closed
opened 2026-03-03 14:35:22 +03:00 by kerem · 5 comments
Owner

Originally created by @gregorymachon on GitHub (Oct 31, 2016).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/324

Hi @lipis

We're looking into slimming down flags size, especially >400kB ones like rs or do.
Our use case requires 60x45px as the largest size so the pixel perfection is not exactly the key factor.

We've tried https://jakearchibald.github.io/svgomg/ and at least rs goes down quite significantly.

I doubt you'll be willing to optimise them all using this tool, but maybe mentioning it in the README.md may be of value to some users.

Cheers /Greg

Originally created by @gregorymachon on GitHub (Oct 31, 2016). Original GitHub issue: https://github.com/lipis/flag-icons/issues/324 Hi @lipis We're looking into slimming down flags size, especially >400kB ones like `rs` or `do`. Our use case requires 60x45px as the largest size so the pixel perfection is not exactly the key factor. We've tried https://jakearchibald.github.io/svgomg/ and at least `rs` goes down quite significantly. I doubt you'll be willing to optimise them all using this tool, but maybe mentioning it in the README.md may be of value to some users. Cheers /Greg
kerem closed this issue 2026-03-03 14:35:23 +03:00
Author
Owner

@lipis commented on GitHub (Oct 31, 2016):

In some use cases it might make sense.. I'll give it a try to see the results and if it's not ruining the quality too much I might use it for the big flags..

In general I'm using the SVGO before pushing the flags..

<!-- gh-comment-id:257265202 --> @lipis commented on GitHub (Oct 31, 2016): In some use cases it might make sense.. I'll give it a try to see the results and if it's not ruining the quality too much I might use it for the big flags.. In general I'm using the [SVGO](https://github.com/svg/svgo) before pushing the flags..
Author
Owner

@lipis commented on GitHub (Oct 31, 2016):

Also I've seen this tool in the past.. and there is no command line for it if I recall.. right? Maybe that changed..?

<!-- gh-comment-id:257265488 --> @lipis commented on GitHub (Oct 31, 2016): Also I've seen this tool in the past.. and there is no command line for it if I recall.. right? Maybe that changed..?
Author
Owner

@gregorymachon commented on GitHub (Oct 31, 2016):

Just had a look here https://github.com/jakearchibald/svgomg

SVGOMG = SVGO + MG (Missing GUI) :)

So it's pretty much the same thing, with I guess some additional options switched on by default (in the GUI).

<!-- gh-comment-id:257266031 --> @gregorymachon commented on GitHub (Oct 31, 2016): Just had a look here https://github.com/jakearchibald/svgomg SVGOMG = SVGO + MG (Missing GUI) :) So it's pretty much the same thing, with I guess some additional options switched on by default (in the GUI).
Author
Owner

@lipis commented on GitHub (Oct 31, 2016):

right..

<!-- gh-comment-id:257289418 --> @lipis commented on GitHub (Oct 31, 2016): right..
Author
Owner

@gregorymachon commented on GitHub (Nov 3, 2016):

Thanks for updating rs flag.

Just an FYI, on our end we've ended by with running: svgo -f ./flags/4x3 -o ./flags/4x3 --config=svgo.yml --precision=1 using below svgo.yml saving ~30% on the overall size.

plugins:
    - cleanupAttrs      
    - cleanupEnableBackground
    - cleanupIDs
    - cleanupNumericValues
    - collapseGroups
    - convertColors
    - convertPathData
    - convertShapeToPath
    - convertStyleToAttrs
    - convertTransform
    - mergePaths
    - moveElemsAttrsToGroup
    - moveGroupAttrsToElems
    - removeComments
    - removeDesc
    - removeDimensions
    - removeDoctype
    - removeEditorsNSData
    - removeEmptyAttrs
    - removeEmptyContainers
    - removeEmptyText
    - removeHiddenElems
    - removeMetadata
    - removeNonInheritableGroupAttrs
    - removeUnknownsAndDefaults
    - removeUselessDefs
    - removeUnusedNS
    - removeUselessStrokeAndFill
    - removeXMLProcInst
<!-- gh-comment-id:258113963 --> @gregorymachon commented on GitHub (Nov 3, 2016): Thanks for updating `rs` flag. Just an FYI, on our end we've ended by with running: `svgo -f ./flags/4x3 -o ./flags/4x3 --config=svgo.yml --precision=1` using below `svgo.yml` saving ~30% on the overall size. ``` plugins: - cleanupAttrs - cleanupEnableBackground - cleanupIDs - cleanupNumericValues - collapseGroups - convertColors - convertPathData - convertShapeToPath - convertStyleToAttrs - convertTransform - mergePaths - moveElemsAttrsToGroup - moveGroupAttrsToElems - removeComments - removeDesc - removeDimensions - removeDoctype - removeEditorsNSData - removeEmptyAttrs - removeEmptyContainers - removeEmptyText - removeHiddenElems - removeMetadata - removeNonInheritableGroupAttrs - removeUnknownsAndDefaults - removeUselessDefs - removeUnusedNS - removeUselessStrokeAndFill - removeXMLProcInst ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#196
No description provided.