Skip to content
Images

4 min read

Optimize Website Images from Source File to Published Page

Use a repeatable image workflow that balances crop, dimensions, format, quality, accessibility, and actual page load behavior.

By GoldieKit · Published

Image asset moving through crop, resize, and delivery stages

Website image optimization is more than moving a quality slider. An image can be compressed well and still be unnecessarily large because its dimensions are too wide. It can be small and still fail because a crop hides the subject, text becomes unreadable, or the browser discovers it too late. A reliable workflow starts with the image's role on the page and ends by checking the published result.

Define the job of the image

Identify the slot: hero, article illustration, product gallery, avatar, or small card. Note the largest width it actually occupies and whether users need to zoom in. Decide whether transparency is required. A photograph usually tolerates a different format and quality trade-off from a logo or screenshot containing tiny text. If the image conveys information, write meaningful alternative text; if it is purely decorative, mark it appropriately in the page implementation rather than inventing a description.

For a product image, the essential question is whether a buyer can see shape, material, and any relevant label. For a process diagram, thin lines and labels matter more than photographic texture. A single byte target cannot answer both questions. Start with a clean source and preserve it so future exports do not have to be made from a previously compressed copy.

Work in the right order

First crop away empty or misleading edges with Crop image if composition requires it. Then choose dimensions based on the page layout with Resize image. Only then compare formats and quality with Convert image or Compress image. If the design has substantially different widths, make a small set of responsive variants.

Suppose a 4200 × 2800 pixel photo appears as a 720 CSS-pixel article image. Exporting it at 4200 pixels with aggressive JPEG compression may still transfer more than necessary. A version around 1440 pixels wide could retain detail for a high-density display; then compare JPEG and WebP at visibly acceptable quality. The right width depends on zoom, crop, and layout. Test rather than treating 1440 as a universal answer.

Compare actual outputs

Keep a simple comparison sheet for each candidate: dimensions, format, bytes, and what changed visually. Inspect at 100% zoom and at the real display size. Look at faces, fabric, gradients, text, and dark areas. JPEG may introduce ringing around sharp boundaries; a poorly chosen lossy setting may smear texture. PNG preserves exact decoded pixel values but can be unnecessarily large for a photograph. WebP and AVIF support useful compression modes, but verify that the destination system and browser path accept the output.

Asset First candidates to compare Critical visual check
Photograph JPEG and lossy WebP Faces, texture, gradients
Diagram or screenshot PNG and lossless WebP Text and thin rules
Transparent icon PNG or WebP with alpha Edge halos on light and dark backgrounds

The compression decisions article explains the lossless and lossy trade-offs in more depth. Here the goal is a repeatable shipping process: choose, export, inspect, integrate, measure, and revise.

Integrate without layout shift

In the page markup, reserve the image's aspect ratio with width and height attributes or equivalent CSS. An unsized image can push content down after loading, harming usability. Use a responsive srcset and accurate sizes where the layout warrants variants. Do not lazy-load the likely largest content image above the fold without measuring the effect; delayed discovery can hurt perceived load time. Images lower on the page may benefit from lazy loading.

Use descriptive filenames for maintainability, but do not expect a filename alone to improve a page. The image should support the surrounding article or task. Avoid decorative stock art that adds bytes without explaining anything. A clear SVG may be better for a simple diagram, while a photograph should remain a raster image.

Measure the published page

Open the deployed page in a fresh browser session and inspect network transfers. Confirm the expected variant loads, the response is cached appropriately, and the image does not shift nearby text. Test phone and desktop widths and both appearance modes if the image has transparency. If a content management system recompresses uploads, inspect the delivered asset; it may differ from the file you submitted.

Core Web Vitals are experienced on real devices and networks. A local desktop test is useful for finding obvious excess, but it cannot prove a universal LCP result. Focus on reducing unnecessary bytes and ensuring the main image is discovered and rendered promptly. Revisit the page after changes to fonts, ads, or layout because those can affect the same visual timing.

A short release checklist

Did you keep the original? Is the crop truthful? Do the dimensions match the largest real slot? Are format and transparency compatible? Is detail readable? Are variants and sizes correct? Is space reserved? Does the published page fetch the intended file at phone and desktop widths? If you can answer these with the actual deployed page, the image is optimized for its job rather than for an arbitrary score.


Put the ideas to work


Keep exploring

All guides