SquishPixel Blog · Image optimisation · Image formats · Web performance

Developer guide: choosing and shipping business website images that stay fast

A guide on DEV Community, written by the web agency aimEncoders, treats website images as both a design choice and an engineering problem. A hero image that looks good in a design tool can still add seconds of load time, layout shift (content jumping around as the page loads) and mobile data use if formats, sizes and delivery are ignored.

On the choice of images, the guide says real photos of the team, workplace, products and finished work build more trust than generic stock shots. It suggests paying for real photography on the most important pages first, and using licensed stock for supporting visuals. It also advises setting one visual direction for colour, light and cropping so the site looks consistent.

On the technical side, the guide recommends WebP as the default format for photos, with JPEG as a fallback, PNG only where transparency is needed, and SVG for logos and icons. It gives starting sizes: a hero banner around 1600 to 1920 pixels wide, a blog featured image around 1200 by 675 pixels, and a product image around 1000 by 1000 pixels. Images should be resized before upload, then compressed with a tool such as TinyPNG or Squoosh. The author says to check the result by eye for blur or blocky edges.

The developer notes cover responsive images using srcset and sizes, so each device gets a suitably sized file. They also cover loading="lazy" for images below the fold, and width and height attributes so the browser reserves space and avoids layout shift. A picture element can serve WebP with a JPEG fallback, ideally generated at build time with a tool like Sharp or Squoosh, or by an image CDN. The guide also covers plain-language alt text, sensible file names and checking image licences, and ends with a pre-launch checklist and a Lighthouse test on a real mid-range phone over a slow connection.

Why it matters

The guide shows that image work is shared between designers, developers and the business owner. Picking the photo, sizing it, compressing it, describing it and confirming the licence each affect speed, trust or legal risk. If one step is skipped, the others cannot make up for it.

The advice is written by an agency that sells web development, so treat the specifics as one team's practice rather than fixed rules. Even so, the checks are cheap and match what most site owners can do: resize, compress, add alt text and test on a phone.

Source: DEV Community. This brief summarises their reporting; read the original for the full detail.