Skip to content
Dashboard

Images on the web

Staff Developer Advocate

Learn about the differences between image formats, compression techniques, resolution capabilities, pixel density, and effects on user experience.

Copy link to headingCompression Algorithms

Copy link to headingPixel Density and Resolution

Copy link to heading
Bit Depth

Copy link to headingChroma Subsampling

Copy link to headingProgressive vs. Baseline Loading

Baseline loading
Baseline loading
Progressive loading
Progressive loading

Copy link to headingAlpha Channel (Transparency)

Copy link to headingMetadata and Exif Data

Exif data demo: https://photos.sambecker.com/
Exif data demo: https://photos.sambecker.com/

Copy link to headingJPEG (Joint Photographic Experts Group)

Copy link to headingPNG (Portable Network Graphics)

Copy link to headingWebP

Copy link to headingAVIF (AV1 Image File Format)

Copy link to headingNext.js Image component

next.config.js
module.exports = {
images: {
formats: ['image/avif', 'image/webp'],
},
}

This configuration enables AVIF support. If the `images.formats` property is omitted, it defaults to WebP.

// Good quality. A balance between image clarity and file size, suitable for most web use cases.
<Image quality={75} />
// Maximum quality. Ensures the best clarity but results in the largest file size.
<Image quality={100} />
// Very low quality. The image will be compressed significantly, resulting in a smaller file size but noticeably reduced clarity.
<Image quality={33} />

// Takes full viewport width on screens up to 768 pixels wide, otherwise half viewport. Useful for mobile devices in portrait mode.
<Image sizes="(max-width: 768px) 100vw, 50vw" />
// Half viewport with on devices up to 768 pixels wide. For devices between 769 and 1200 pixels wide, it will take up a third of the viewport width. Useful for images in multi-column layouts
<Image sizes="(max-width: 768px) 50vw, (max-width: 1200px) 33vw, 20vw" />
// Regardless of the device's width, the image will always render at 500 pixels wide.
<Image sizes="500px" />

Copy link to headingConclusion

Ready to deploy?