Manual:Assets

MediaWiki includes some binary assets in its code.

PNG images
PNG files are needed for browsers without SVG compatibility.

All PNG images/icons included in our code are usually optimized with pngcrush or optipng, which offer automatic detection of the method with best results for the target files (and are packaged in several GNU/Linux distributions). For instance: pngcrush -brute -reduce image.png image.out.png

It's possible to add a PNG fallback like this in your CSS, using The invisible gradient technique:

In MediaWiki 1.24+, something else is possible too:.

SVG files
Every image should exist also (or rather, primarily) in SVG format.

SVG files need to be optimized as well. For most core files, svgo was used, but you need to make sure a compatible prolog is kept, for instance with this snippet:

If your SVG files are already well-formed and have an XML prolog, you can simply do (for the current folder):

For a more aggressive optimisation (e.g. if you don't care about reading the SVG source later), remove all the options above.