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
JPG No No Very Small Good Lossy Yes Yes Yes
PNG Yes No Medium Very Good Lossless Yes Yes Yes
APNG Yes Yes Medium-Big Very Good Lossless Yes Yes No
ZopfliPNG Yes No Small Very Good Lossless Yes Yes Yes
GIF Yes Yes Medium-Big Bad Lossless Yes Yes Yes
Brotli Yes No Small-Very Small Lossless Very Good Yes Yes Yes
SVG YesYesVery SmallVery Good Lossless YesYesYes
WebP YesYesVery SmallVery Good Lossless YesYesYes

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
JPG
yum install jpegoptim Very Good Very Good
Brotli Very Good Very Good
TinyPNG Very Good Very Good
SVG
esgtools Very Good Very Good
/home/www/sites/esgr.in/wiki/data/attic/development/webimages.1522159826.txt.gz · Last modified: 2018/03/27 14:10 by eServices Greece