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

Optimize and fix up some SVGs #80119

Merged

Conversation

MewPurPur
Copy link
Contributor

@MewPurPur MewPurPur commented Aug 1, 2023

Addresses some icons I missed in my SVG optimization PRs. A few of them are small fix-ups, like tiny lines in the middle of arcs or unintentional elliptical arcs where they meant to be circlular. This saves about 5 kB.

Also I changed the opacity of some icons slightly. Many icons used alphas like 50 or 100. When doing 50/255 for example, it can get thrown off and become something like 0.19608 when opened in an editor. The alpha values 51, 102, 153, and 204 result in no precision inconsistencies (as they are 0.2, 0.4, 0.6, 0.8) so I used them where the change isn't noticeable. Even if it's noticeable, it's probably for the better, as some people have complained about low opacity icons. Where not applicable (e.g. an alpha value of 20, which isn't close to any of these), I changed to use at most 3 digits of precision.

^ I don't think this needs to be enforced strictly, it's just a nice thing to do once IMO, and also artists probably often copy the opacity of existing icons. (or maybe it's just me doing things like that? 😅)

@MewPurPur MewPurPur requested a review from a team as a code owner August 1, 2023 14:00
@dalexeev dalexeev added this to the 4.x milestone Aug 1, 2023
@MewPurPur MewPurPur force-pushed the svg-opacities-standardization branch from abf53b8 to c2aa71f Compare August 1, 2023 16:50
@Calinou
Copy link
Member

Calinou commented Aug 1, 2023

This saves about 5 MB.

I think you meant 5 KB? 😛

@MewPurPur MewPurPur force-pushed the svg-opacities-standardization branch from c2aa71f to dbd3949 Compare August 1, 2023 17:06
@MewPurPur
Copy link
Contributor Author

Fixed!

@MewPurPur MewPurPur force-pushed the svg-opacities-standardization branch 8 times, most recently from 1cf41c2 to 401e3a2 Compare August 8, 2023 10:05
@MewPurPur MewPurPur force-pushed the svg-opacities-standardization branch 4 times, most recently from ed6cba8 to 963f456 Compare August 12, 2023 22:26
@MewPurPur
Copy link
Contributor Author

Of course this went on to become more of a dumping ground for more tweaks and improvements, so it's more like 8 kB now.

@MewPurPur MewPurPur force-pushed the svg-opacities-standardization branch from 963f456 to 4046609 Compare August 12, 2023 23:09
@MewPurPur MewPurPur force-pushed the svg-opacities-standardization branch from 4046609 to 93318d2 Compare August 13, 2023 14:48
@MewPurPur MewPurPur requested review from a team as code owners August 13, 2023 14:48
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. Icons still look fine in the editor.

Binary sizes before/after (Linux x86_64, stripped debug editor build):

170,677,168  godot.linuxbsd.editor.x86_64.master
170,669,360  godot.linuxbsd.editor.x86_64.pr

@akien-mga akien-mga modified the milestones: 4.x, 4.2 Aug 18, 2023
@akien-mga akien-mga merged commit a017e9c into godotengine:master Aug 18, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@MewPurPur MewPurPur deleted the svg-opacities-standardization branch August 18, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants