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 images #5147

Conversation

efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc commented May 21, 2024

Optimize images

Pull Request Type

  • Chore

Related issue

#4976 #4898

Description

The new high quality SVG's are awesome but increased our image size allot compared to the old ones. I went on a quest to optimize our images for the gazillionth time and it looked like I was successful :)

Screenshots

Before:

before

After:

Capture

Testing

Check if all the images appear the same, check for quality reduction

Additional context

Tools used:

A little bird (@absidue) told me about this issue and that what triggered this side quest :)

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 21, 2024 20:10
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label May 21, 2024
absidue
absidue previously approved these changes May 21, 2024
kommunarr
kommunarr previously approved these changes May 21, 2024
@PikachuEXE
Copy link
Collaborator

PikachuEXE commented May 22, 2024

I tried https://github.com/svg/svgo locally after checking out this branch and see better reported results
image

No idea what to use for PNG & ICO yet (I might or might not find a tool for those)

Edit 1: Found an action which uses svgo and got other image optimizations: https://github.com/marketplace/actions/imgcmp
I know we have https://github.com/calibreapp/image-actions already but maybe we can try this out (another PR I guess)

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Member Author

efb4f5ff-1298-471a-8973-3d47447115dc commented May 22, 2024

Oh looks promissing. The SVG tool I used does lossless compression but this one doesnt specify so got to look into that.

The other tools i used use lossy compression.

But we indeed can leave this for another PR

Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

OK let's see if possible to use the new action in another PR (how to test though ?_?

SVGO got a default preset of plugins, not sure lossless or not
https://svgo.dev/docs/preset-default/

@PikachuEXE
Copy link
Collaborator

Also got better results with PNG with optiPNG
find ./_icons -iname '*.png' -print0 | xargs -0 -n 1 -P 4 optipng -o7
partial results (the whole result is very long)
image

@FreeTubeBot FreeTubeBot merged commit ebc9111 into FreeTubeApp:development May 26, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label May 26, 2024
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.

None yet

5 participants