Skip to content

Optimize SVG images#189

Open
Niels-IO wants to merge 2 commits into
masterfrom
optimizeSVGImages
Open

Optimize SVG images#189
Niels-IO wants to merge 2 commits into
masterfrom
optimizeSVGImages

Conversation

@Niels-IO

@Niels-IO Niels-IO commented Dec 1, 2023

Copy link
Copy Markdown
Owner

This would be a breaking change, as the Image component just passed SVG through.

This PR would optimize SVGs into images (webp or png) which could be smaller sometimes.

The unoptimized prop would yield the original SVG.

What is missing currently, is for remote images to create a src with a downloaded (and unoptimized) version of the svg and fall back to the remote source if the local image is not available.

@Niels-IO Niels-IO mentioned this pull request Dec 1, 2023
@Niels-IO Niels-IO linked an issue Dec 1, 2023 that may be closed by this pull request
@joshuabaker

Copy link
Copy Markdown

In my opinion, I don’t think it’s wise to make these lossy (i.e. webp or png). Instead, using SVGO with a minimal set of default adjustments (i.e. to avoid excessive path minification) would be better (as requested in #195).

@joshuabaker

Copy link
Copy Markdown

As noted in #184 (comment), just passing these through is likely the best starting point for SVG handling.

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.

Using remote SVGs

2 participants