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

Remove pngquant #170

Closed
wants to merge 20 commits into from
Closed

Remove pngquant #170

wants to merge 20 commits into from

Conversation

joehoyle
Copy link
Member

@joehoyle joehoyle commented Nov 20, 2023

This drastically reduces sizes of PNG files too

Before:

    │ Image                        │ Original Size │ Tachyon Size       │ 100px         │ 300px         │ 700px         │ 700px webp         │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ Website.png                  │ 33.16 kB      │ 49.99 kB (150%)    │ 8.66 kB       │ 50.35 kB      │ 49.99 kB      │ 20.29 kB (40%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ briefing-copywriting.jpg     │ 453.15 kB     │ 115.37 kB (25%)    │ 3.07 kB       │ 9.54 kB       │ 29.31 kB      │ 15.79 kB (53%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ hdr.jpg                      │ 227.92 kB     │ 148.96 kB (65%)    │ 10.64 kB      │ 24.34 kB      │ 87.55 kB      │ 82.81 kB (94%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ icons.png                    │ 96.5 kB       │ 60.46 kB (62%)     │ 6.01 kB       │ 20.67 kB      │ 51.15 kB      │ 23.76 kB (46%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ humans.png                   │ 2.33 MB       │ 3.55 MB (152%)     │ 29.85 kB      │ 201.02 kB     │ 1.06 MB       │ 142.8 kB (13%)     │
    └──────────────────────────────┴───────────────┴────────────────────┴───────────────┴───────────────┴───────────────┴────────────────────┘```

After:

    ┌──────────────────────────────┬───────────────┬────────────────────┬───────────────┬───────────────┬───────────────┬────────────────────┐
    │ Image                        │ Original Size │ Tachyon Size       │ 100px         │ 300px         │ 700px         │ 700px webp         │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ Website.png                  │ 33.16 kB      │ 37.7 kB (113%)     │ 3.38 kB       │ 14.13 kB      │ 37.7 kB       │ 20.29 kB (53%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ briefing-copywriting.jpg     │ 453.15 kB     │ 115.37 kB (25%)    │ 3.07 kB       │ 9.54 kB       │ 29.31 kB      │ 15.79 kB (53%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ hdr.jpg                      │ 227.92 kB     │ 148.96 kB (65%)    │ 10.64 kB      │ 24.34 kB      │ 87.55 kB      │ 82.81 kB (94%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ icons.png                    │ 96.5 kB       │ 29.27 kB (30%)     │ 3.88 kB       │ 10.96 kB      │ 24.85 kB      │ 23.76 kB (95%)     │
    ├──────────────────────────────┼───────────────┼────────────────────┼───────────────┼───────────────┼───────────────┼────────────────────┤
    │ humans.png                   │ 2.33 MB       │ 856.69 kB (36%)    │ 16.05 kB      │ 63.87 kB      │ 283.84 kB     │ 142.8 kB (50%)     │
    └──────────────────────────────┴───────────────┴────────────────────┴───────────────┴───────────────┴───────────────┴────────────────────┘

@joehoyle
Copy link
Member Author

Tests are failing as it seems libwebp is not quite deterministic across systems / architectures 🤔

@johnbillion johnbillion linked an issue Nov 20, 2023 that may be closed by this pull request
This was previously not implemented, it turns out there's an somewhat unknown API to do it on `awslambda`.
@rmccue
Copy link
Member

rmccue commented Nov 20, 2023

So pngquant is making it worse? 🤔

@joehoyle
Copy link
Member Author

Compared to using sharp to compress the png

@joehoyle
Copy link
Member Author

SOrry this was breaking the lambda build... fixing now

@joehoyle joehoyle marked this pull request as draft November 20, 2023 19:42
@joehoyle
Copy link
Member Author

Split this out into #173 and #174

@joehoyle joehoyle closed this Nov 20, 2023
@joehoyle joehoyle deleted the remove-pngquant branch November 20, 2023 20:52
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.

pngquant is no longer needed
2 participants