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

Automatically run oxipng on example screenshots #1547

Merged
merged 12 commits into from
Jul 16, 2024
Merged

Automatically run oxipng on example screenshots #1547

merged 12 commits into from
Jul 16, 2024

Conversation

Chubercik
Copy link
Contributor

@alice-i-cecile alice-i-cecile added C-Automation Tools to make repetitive tasks easier A-Examples labels Jul 9, 2024
@Chubercik
Copy link
Contributor Author

Chubercik commented Jul 9, 2024

By comparing the artifact sizes of the last official GA workflow run and the one run on this PR, we can see noticeable reductions:

Artifact Current This PR Size reduction
screenshots-0 4.5 MB 3.47 MB -22.9%
screenshots-1 7.05 MB 5.69 MB -19.3%
screenshots-2 976 KB 565 KB -42.1%
screenshots-3 3.34 MB 1.98 MB -40.7%
screenshots-4 1.28 MB 749 KB -41.5%
screenshots-5 3 MB 1.93 MB -35.7%
screenshots-6 3.1 MB 1.99 MB -35.8%
screenshots-7 3.28 MB 2.26 MB -31.1%
screenshots-8 3.63 MB 2.57 MB -29.2%
screenshots-9 4.61 MB 2.66 MB -42.3%
screenshots-10 1.77 MB 1.21 MB -32.7%
screenshots-11 3.87 MB 3.06 MB -20.9%
screenshots-12 1.95 MB 1.53 MB -21.5%
all screenshots 42.36 MB 29.66 MB -30%

It's worth noting that the sizes from the current workflow aren't the same as image sizes that would be used on the website, given the fact that @mockersf used pngcrush on them manually before merging #1530; still, we can see that this PR achieves better compression when comparing actual size changes in the GH "Files changed" tabs:

A few examples:

Image Preview Current This PR
2D Rendering/2d_shapes.png image -9.81 KB (53%) -14.4 KB (31%)
2D Rendering/2d_viewport_to_world.png image -11.2 KB (25%) -14.7 KB (1.4%)
2D Rendering/mesh2d_arcs.png image +18.3 KB +10.6 KB
Window/screenshot.png image -131 KB (58%) -177 KB (44%)
ECS (Entity Component System)/observers.png image +232 KB +210 KB

Copy link
Member

@TrialDragon TrialDragon left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@janhohenheim janhohenheim left a comment

Choose a reason for hiding this comment

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

LGTM, just left a note for optimizing speed

.github/workflows/update-screenshots.yml Outdated Show resolved Hide resolved
@janhohenheim janhohenheim added S-Ready-For-Final-Review Ready for a maintainer to consider for merging and removed S-Needs-Review labels Jul 10, 2024
@Chubercik
Copy link
Contributor Author

Chubercik commented Jul 10, 2024

With @janhohenheim's suggestion applied, oxipng's install time has been brought down to ~1 second, effectively cutting the total compression overhead to around half its previous length ^^

@mockersf mockersf removed the S-Ready-For-Final-Review Ready for a maintainer to consider for merging label Jul 10, 2024
Copy link
Member

@mockersf mockersf left a comment

Choose a reason for hiding this comment

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

Could you remove cargo-install usage?

@Chubercik Chubercik requested a review from mockersf July 11, 2024 21:17
Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for doing this!

I have two notes for how to improve the workflow, but they're nits that don't prevent this from being merged. :)

.github/workflows/update-screenshots.yml Outdated Show resolved Hide resolved
.github/workflows/update-screenshots.yml Outdated Show resolved Hide resolved
@BD103 BD103 added the S-Ready-For-Final-Review Ready for a maintainer to consider for merging label Jul 12, 2024
@BD103
Copy link
Member

BD103 commented Jul 16, 2024

@alice-i-cecile would you mind merging this, when you have the chance? I think it was missed in today's merge train. (Which is understandable, given how many PRs you had to merge today!)

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 16, 2024
Merged via the queue into bevyengine:main with commit 7762506 Jul 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Examples C-Automation Tools to make repetitive tasks easier S-Ready-For-Final-Review Ready for a maintainer to consider for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically run pngcrush on example screenshots
6 participants