The weight of an image, just like any other file, corresponds to the size it occupies in bytes on a hard disk. It also corresponds to the amount of data to be exchanged with the WEB server, in order to be retrieved by the browser to display it on a page.
Images can be saved in different formats and can be optimized using compression algorithms, with or without loss of quality.
The most common formats are :
The weight of images can quickly become problematic, it generally takes up a significant place in the overall weight of resources to be loaded on a page. Images can therefore seriously slow down the complete loading of a page and its global rendering by the browser. Compressing an image can drastically reduce its weight, so it is essential to optimize it since the user will not see any difference in its quality.
Optimizing images means adapting their format and quality for the WEB, it is useful to :