Blog
Image formats
Posts about Image formats.
-
How to compress an image to a target file size in the browser with the Canvas API
A DEV Community guide shows how to shrink a photo to a set size, such as 50 KB, in the browser by searching for the best JPEG quality setting.
-
Site audit finds the srcset habit misses the real image problems
A DEV Community audit of one production site found lazy loading, screen maths and file format mattered more than adding srcset to every image.
-
How to compress a JPG to an exact file size in the browser
A DEV Community post explains how to hit a strict KB limit for a JPEG using a browser search of quality and size, and why '50 KB' has two meanings.
-
A PNG saved with a .webp filename cost one services page 441 KiB on mobile
A site owner found a PNG disguised as WebP, rebuilt it as a real WebP, and lifted a mobile PageSpeed score from 72 to 85, per DEV Community.
-
Landing page photos were JPEGs renamed .webp, and two went to visitors at full size
A DEV Community post details three JPEGs renamed .webp, mislabelled by the server, and two served unoptimised through CSS backgrounds at 1.87 MB.
-
Next.js image defaults allow 15 widths, one quality and no AVIF unless you change them
A DEV Community post probes the default Next 16.2.7 image endpoint and finds fixed widths, one quality, WebP only and a revalidating cache header.
-
Convert CMYK JPEG uploads to sRGB with sharp, not with a formula
A DEV Community test shows sharp converts CMYK JPEGs to sRGB by default, while the common one-line pixel formula gets colours badly wrong.
-
Developer guide: choosing and shipping business website images that stay fast
DEV Community guide covers picking real photos, sizing, WebP, compression, alt text, licensing and responsive image code for faster business sites.
-
Stripping WebP from Chrome's Accept header mostly just gets you AVIF, test finds
A DEV Community test of five image hosts found that removing WebP from the Accept header usually returns AVIF, not JPEG, on large image CDNs.
-
Linear light resampling keeps detail but can cost shadow accuracy, tests show
A DEV Community author tested linear light resizing on a photo and found it keeps more detail but loses shadow accuracy, banding risk and sharpening quality.
-
AVIF first, WebP as fallback is the advice for image-heavy product pages
A DEV Community post says image-heavy sites should serve AVIF first with WebP as fallback, and test both formats on their own fine-texture images.
-
Re-encoding a JPEG in a browser canvas can make the file bigger, tests show
Tests of 25 photos found canvas re-exports at JPEG quality 0.92 grew some files in all three browser engines, and size targets did not prevent it.