-
Notifications
You must be signed in to change notification settings - Fork 1.1k
USWDS - Banner: Optimize banner flag icon, provide vector option #5542
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
Conversation
|
Thanks for this. We're going to check and see if we can get it into 3.7.0, otherwise it'll probably go into the subsequent release. |
mejiaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mahoneycm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm!
- No visual regression
- File size noticeably smaller
- Both images are correctly compiled into the
distdirectory
thisisdano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!


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.pngimage. 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?
.svgis larger size uncompressed than the.pngfile, 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.