Image optimization

Image Dimensions vs File Size

Dimensions count pixels; file size counts encoded bytes. More pixels usually provide more data to encode, but compression and content also matter.

Pixels and encoded bytes

An image 2000 × 1500 contains four times as many pixels as a 1000 × 750 image. It does not necessarily produce exactly four times the bytes because formats compress content differently, but larger dimensions generally require more data.

A flat illustration can encode compactly despite large dimensions, while a noisy photograph may remain large at smaller dimensions. Format and quality settings change bytes without changing dimensions.

Match dimensions to display

Use the rendered CSS size and account for device pixel ratio. A 2× source can appear sharp on a high-density display, but sending a very large original to a small thumbnail wastes bandwidth and decode memory.

Responsive image markup can deliver different dimensions to different screens. Use a resize tool to create derivatives, then make sure the page actually selects the right one.

Frequently asked questions

Will resizing always shrink a file?

Reducing dimensions often shrinks a file, but the chosen output encoder can still produce a larger file in some cases.

← All image guides