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

Optimised images losslessly. #229

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

grischard
Copy link
Contributor

Saved 301 KB out of 9.2 MB. 15.8% per file on average (up to 82.2%)

Fixes #.

Saves 301 KB (although not all files are included in the build)

Description of the changes:

  • For PNG files: used a combination of Pngcrush, OxiPNG, AdvPNG, PNGOUT and Zopfli
  • For GIF files: used Gifsicle

How changes were validated:

  • No changes to behaviour or source code.
  • Previewed the changed files to make sure they still work

@msftclas
Copy link

msftclas commented Mar 9, 2019

CLA assistant check
All CLA requirements met.

@HowardWolosky
Copy link
Member

Interesting, thanks for the submission. We do have an automated process that @danbelcher-MSFT wrote which runs TruePNG on our product images (we may have missed running it on the repo-only images). I remember that there were other tools that he had tried out and chose not to use for various reasons, but I'm not sure if any were in the list that you used.

Daniel -- Had you tried any of these back when writing our Image Compression automation?

@jlaanstra
Copy link
Contributor

LGTM

@HowardWolosky
Copy link
Member

#273 has issued a similar change, but against fewer files. It would be good to understand the difference in the optimization result between these two PR's.

@danbelcher-MSFT
Copy link

Daniel -- Had you tried any of these back when writing our Image Compression automation?

Nope. Different tools will optimize in different ways. We aren't checking image compression any longer in our build pipelines. If the community wants to crush the images further, that's fine with me. We'll eventually end up with the most optimized images in the OSS community!

#273 has issued a similar change, but against fewer files. It would be good to understand the difference in the optimization result between these two PR's.

Let's take this change and then have the author of #273 re-run their optimizations. If it produces a diff, we can check that in as well.

@danbelcher-MSFT
Copy link

Thanks, @grischard!

@danbelcher-MSFT danbelcher-MSFT merged commit ac5292c into microsoft:master Mar 13, 2019
@HowardWolosky
Copy link
Member

HowardWolosky commented Mar 14, 2019

@danbelcher-MSFT - this change will only impact the dev build, not our Store build (see my comment in #273).. These files were previously optimized with your TruePNG tooling. If there are legit benefits seen here, we should look into updating our internal tooling too.

For clarity to anyone else reading this comment, the Store version is built directly from the code in this repo, however the icons are replaced before the official build starts. We use a different set of icons in the dev build vs the official build to help distinguish the unofficial vs official builds. We also don't sign the dev builds. So, optimizations made to the icons in this repo have no impact to the Store version since these are non-shipping icons. Instead of necessarily optimizing these icons, we should be updating the process that we use to internally to optimize the shipping icons, hence my interest more on the process that was used in these two PR's as opposed to this specific result.

@HowardWolosky
Copy link
Member

I edited the comment above, but I'm also posting that update below since there was some misunderstandng by some around the original comment and I want to be sure to make this super clear:

For clarity to anyone else reading the above comment, the Store version is built directly from the code in this repo, however the icons are replaced before the official build starts. We use a different set of icons in the dev build vs the official build to help distinguish the unofficial vs official builds. We also don't sign the dev builds. So, optimizations made to the icons in this repo have no impact to the Store version since these are non-shipping icons. Instead of necessarily optimizing these icons, we should be updating the process that we use to internally to optimize the shipping icons, hence my interest more on the process that was used in these two PR's as opposed to this specific result.

@grischard
Copy link
Contributor Author

It would be very cool to hear back once you've looked at the internal image pipeline. And I imagine Microsoft also has more software that includes images and gets downloaded often...

@danbelcher-MSFT
Copy link

Hey @grishard, would you mind sharing what specific commands you ran for each of these tools, if any? It would help when we want to add this as part of our internal process and I won't need to go learn each of the tools.

@grischard
Copy link
Contributor Author

Hey @danbelcher-MSFT, sorry I missed your question a year ago! I used ImageOptim which simply brute forces combinations of optimisation tools. It's Mac-only, but the website lists similar tools for Windows.

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.

5 participants