From Image Optimization:
Image optimization boils down to two criteria: optimizing the number
of bytes used to encode each image pixel, and optimizing the total
number of pixels: the filesize of the image is simply the total number
of pixels times the number of bytes used to encode each pixel. Nothing
more, nothing less.
As a result, one of the simplest and most
effective image optimization techniques is to ensure that we are not
shipping any more pixels than needed to display the asset at its
intended size in the browser. Sounds simple, right? Unfortunately,
most pages fail this test for many of their image assets: typically,
they ship larger assets and rely on the browser to rescale them -
which also consumes extra CPU resources - and display them at a lower
resolution. ...
you should ensure that the number of unnecessary
pixels is minimal, and that your large assets in particular are
delivered as close as possible to their display size
Common error is to have big image in source and scale it down with width
and height
attributes on UI.