USWDS - Banner: Optimize banner flag icon, provide vector option #5542
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the banner flag image with a losslessly compressed version, and adds a new vector (SVG) version of the image.
Related issue
Continues from #4191, closed by #4792.
Related PR
Changelog PR
Problem statement
As an end-user, I expect that pages using the U.S. Web Design system load quickly, so that I don't have to wait for assets to load.
Solution
Optimizes the existing
us_flag_small.png
image. It was optimized using Oxipng, via Squoosh. The choice to use Oxipng was based on a desire for lossless compression, so there should be no degradation in the quality of the image. Lossy compression is possible, and would result in an even smaller file size (I was able to shrink to 168 bytes using TinyPNG), but this would have some marginal effect on the quality of the image. tl;dr "Lossless" seemed least controversial 😄Result:
Before: 545 bytes
After: 244 bytes
Diff: -301 bytes (-55%)
This also proposes to add a hand-optimized vector version of the image, originally proposed at #4191 (comment), and adjusted for this pull request using colors from the higher-quality image added in #4792.
Why?
.svg
is larger size uncompressed than the.png
file, it is still very small (380 bytes), and would compress to the smallest possible size (195 bytes gzipped, 180 bytes brotli'd)Testing and review
Visually inspect the revised assets.