When testing my site with gtmetrix, it suggests the following:
Page Speed
Specifying a width and height for all images allows for faster rendering by eliminating the need for unnecessary reflows and repaints.
Details from Google
When the browser lays out the page, it needs to be able to flow around replaceable elements such as images. It can begin to render a page even before images are downloaded, provided that it knows the dimensions to wrap non-replaceable elements around. If no dimensions are specified in the containing document, or if the dimensions specified don't match those of the actual images, the browser will require a reflow and repaint once the images are downloaded. To prevent reflows, specify the width and height of all images, either in the HTML <img>
tag, or in CSS.
YSlow
Scaling images in HTML can result in unnecessary bandwidth wasted downloading large images.
Details from Yahoo!
Web page designers sometimes set image dimensions by using the width and height attributes of the HTML image element. Avoid doing this since it can result in images being larger than needed.
So, which one to follow? Should I specify image dimension in html or not?