Skip to content

Conversation

@mattheu
Copy link
Member

@mattheu mattheu commented Aug 25, 2022

This plugin can optimise any images that are bundled as part of our build process.

I have configured this out of the box to minimze images losslessly using the following:

  • SVGs are compressed with SVGO (I actually linked to a web interface for this and is a tool I use regularly). Often we'll use icons and logos provided by designers that are poorly optimised. SVG files can contain lots of stuff generated by the tool used to create the image. SVGO strips it out and can often reduce file sizes by 50% or more.
  • JPG files are compressed using jpegtran. I tested this on a 4.6MB file and it reduced it by about 7%. So not a lot! But better than nothing.
  • PNG files. I tested on a couple of images. One very small one exported from Figma, was reduced by about 40% (from 2kb to 1.3kb). But repeating this with another image I didn't see any improvement at all. I guess it depends how well optimised the source image is.

It can support lossy minimization too which I haven't really investigated but it would be good to allow this to be configured with either 🤔

All in all, seems like an easy enhancement to add with little downside.

Any thoughts on including this?

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.

2 participants