Skip to content

Compress images - #9685

Open
efb4f5ff-1298-471a-8973-3d47447115dc wants to merge 2 commits into
FreeTubeApp:developmentfrom
efb4f5ff-1298-471a-8973-3d47447115dc:compress-images
Open

Compress images#9685
efb4f5ff-1298-471a-8973-3d47447115dc wants to merge 2 commits into
FreeTubeApp:developmentfrom
efb4f5ff-1298-471a-8973-3d47447115dc:compress-images

Conversation

@efb4f5ff-1298-471a-8973-3d47447115dc

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc commented Aug 24, 2026

Copy link
Copy Markdown
Member

Pull Request Type

  • Other - Chore

Description

Since the last time I did this, several new images have been added, so I thought it would be a good idea to run image compression across all the repos again.

This time i opted to use SVGO and Oxipng for lossless compression instead of the other web tools i used before. I compared the old tools vs these, the new ones provided a better result.

Screenshots

before left, after right
main

Testing

Check if image quality is the same as before

Additional context

Ill also go ahead and create a PR to remove https://github.com/FreeTubeApp/FreeTube/blob/development/.github/workflows/calibreapp-image-actions.yml as we wont be needing that anymore because this tool has become buggy and doesnt provide good results anymore

@PikachuEXE

Copy link
Copy Markdown
Member

I have no idea how to compare these small ones...
image

@PikachuEXE

Copy link
Copy Markdown
Member

Also you might want to share the commands you used so we can see if there are further optimizations
And can be used in CI (that's later PR definitely

@efb4f5ff-1298-471a-8973-3d47447115dc

efb4f5ff-1298-471a-8973-3d47447115dc commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

I have no idea how to compare these small ones...

Enhance is your best friend

firefox_4IrdQXV0HS.mp4

Also you might want to share the commands you used so we can see if there are further optimizations

Isnt really the goal of this PR. I knew there were new icons added that didnt receive an optimization so optimized the whole directory like i always did. The minor improvements of the already optimized icons are just a nice bonus.

Anyway here are the commands for lossless compression:
VirtualBoxVM_puux9J4Iov
VirtualBoxVM_bZmK9Vot6Y

@PikachuEXE

PikachuEXE commented Aug 25, 2026

Copy link
Copy Markdown
Member

When I run pnpm dlx svgo -r -f . -o . on home folder (without -r won't work) I got 3 additional SVG files optimized
When I run oxipng -o 6 --strip safe --recursive ./_icons ./src I got additional 3 PNG files optimized
(Folder paths passed to avoid nodule_modules, found by find . -path ./node_modules -prune -o -iname '*.png', and there is no exclude option: oxipng/oxipng#721

@efb4f5ff-1298-471a-8973-3d47447115dc

Copy link
Copy Markdown
Member Author

applied oxipng -o max --strip safe *.png to all PR's which returns better results without losing quality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants