Skip to content

feat: compress resized png icons#1099

Merged
ckerr merged 7 commits into
masterfrom
smaller-pngs
Jun 18, 2019
Merged

feat: compress resized png icons#1099
ckerr merged 7 commits into
masterfrom
smaller-pngs

Conversation

@ckerr

@ckerr ckerr commented Jun 16, 2019

Copy link
Copy Markdown
Member

When we generate resized icons – the $foo-32.png, $foo-64.png, $foo-128.png, $foo-256.png files – pipe them through pngquant.

I've intentionally used a lossy compressor here because:

  • These are resized in a batch during npm run build, so CPU cost needs to be reasonable
  • These icons are already derived, so a lossy compression doesn't alter the original files
  • Choosing a lossy compressor gives a better speed/size result than lossless compression

Note that the original source icons are not part of this process. I've manually done lossless compression on them in #1077 and in this PR's first commit, but they are not piped through lossy compressors.

@ckerr ckerr requested review from codebytere and zeke and removed request for zeke June 18, 2019 15:16
@ckerr ckerr merged commit 8557923 into master Jun 18, 2019
@ckerr ckerr deleted the smaller-pngs branch June 18, 2019 15:29
@zeke

zeke commented Jun 18, 2019

Copy link
Copy Markdown
Contributor

Nice! Any idea what the size differences are?

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.

3 participants