aramk / crayon-syntax-highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
https://wordpress.org/plugins/crayon-syntax-highlighter/
GNU General Public License v3.0
1.1k stars 248 forks source link

Optimize PNG assets #309

Open rfnx opened 8 years ago

rfnx commented 8 years ago

Hello,

PNG assets can be optimized, for example with optipng. I was able to reduce the size by 50% on buttons.png and buttons@2x.png, which are loaded for every visitors, without reducing quality. For some other assets, I was able to divide the size by more than 5 (for example /css/images/thumb_horizontal.png) !

It's very simple with optipng (available on every Linux distribution) : optipng -o7 -strip all file.png and to easily optimize all png in a directory and subdirectories : find /path/to/dir -iname '*.png' -exec optipng -o7 -strip all {} \; It is a lot of bytes saved for a very small effort :)

Thanks for this amazing plugin !

mobeigi commented 8 years ago

Yeah I also noticed this when optimizing my website using Google Page Speed Insights.

rfnx commented 8 years ago

As a side note, I added .woff2 versions of the fonts I use in Crayon, it's lighter than .woff format. But I will maybe open a new issue for this.

rfnx commented 8 years ago

Can someone look at this please :) ? It's very easy to do but the new version 2.8.0 still has unoptimised images.