Web Images

This is an old revision of the document!


Rules

Image Dimensions

  • Image Size = Viewport Size.
    • An image has to be equal or max 1% bigger than the maximum viewport size.
    • If you need to cater for variable size viewports, you should use the @media tag and use multiple images
  • Never resize images in code.

Image File Size

  • Make sure your image is as small as possible
    • Compress your images using the most compressible image type, jpg is preferable if no transparency is required.
File Type Transparency Animation Size Quality Compressions Type Chrome Firefox Edge Safari
JPG No No Very Small Good Lossy Yes Yes Yes Yes
PNG Yes No Medium Very Good Lossless Yes Yes Yes Yes
APNG Yes Yes Medium-Big Very Good Lossless Yes Yes No Yes
GIF Yes Yes Medium-Big Bad Lossless Yes Yes Yes Yes
Brotli Yes No Small-Very Small Lossless Very Good Yes Yes Yes Yes
SVG Yes Yes Very Small Perfect Lossless Yes Yes Yes Yes
WebP Yes Yes Very Small Very Good Lossless Yes No No No

Compression Tools

Tool Compression Quality
PNG
Guetzli Very Good Very Good
optiPNG Very Good Very Good
Brotli Very Good Very Good
TinyPNG Very Good Very Good
ZopfliPNG Very Good Very Good
JPG
yum install jpegoptim Very Good Very Good
Brotli Very Good Very Good
TinyPNG Very Good Very Good
SVG
esgtools Very Good Perfect
/home/www/sites/esgr.in/wiki/data/attic/development/webimages.1522160415.txt.gz · Last modified: 2018/03/27 14:20 by eServices Greece