Sub topic 18
Verifying Exported Images
This chapter assumes you can export images from your design tool and know the formats, dimensions, and compression settings covered earlier. Here you check that the exported files are correct, then name them and hand them to developers.
Verifying exported images
An export can look fine in your design tool and still be wrong on the page. Check the files themselves, then check them in a browser.
Check the file properties
Confirm the pixel dimensions, the format, and the file size. ImageMagick prints all three:
magick identify -format "%f %m %wx%h %b\n" hero-800.jpg hero-1600.webpEach line shows the file name, format, pixel size, and byte size. A 2x file should be exactly twice the pixel width and height of its 1x partner.
Check in the browser
Open the file in a browser tab, then open the page that uses it. In the developer tools Network panel, filter by images and look at three columns: the transferred size, the dimensions, and the type. Compare the transferred size with your budget. In the Elements panel, hover over the img tag. The tooltip lists the rendered size and the intrinsic size. The intrinsic size should be close to the rendered size, or twice it for a 2x file.
Look for these common faults:
- Blurry image: the file is smaller than its display size multiplied by the screen density.
- Oversized file: the intrinsic size is far larger than the rendered size.
- Halo around a transparent edge: the export was flattened onto a background color.
- Dull or shifted colors: the file was exported in a non-sRGB color space.
- Wrong file served: the Network panel shows a different file from the one you expected, often because of a typo in
srcset.
For responsive images, resize the browser window and reload. Confirm that the Network panel loads a different file at each width.
Naming and handoff to developers
Developers reference files by name, so a name should describe the content and the variant. Use lowercase letters, digits, and hyphens. Avoid spaces and capitals, because some servers treat Hero.jpg and hero.jpg as different files.
| Pattern | Example | Meaning |
|---|---|---|
| `subject-width.ext` | `hero-800.jpg` | Width in pixels |
| `[email protected]` | `[email protected]` | Double-density version |
| `subject-purpose.ext` | `team-card.webp` | Where it is used |
Avoid names such as final, final2, or export-new. They tell a developer nothing.
Hand off the files in one folder with a short note for each image. The note should give:
- The displayed size in CSS pixels, so developers can set
widthandheight. - The available formats and widths.
- The alt text, or a statement that the image is decorative.
- The size you measured, and the budget it meets.
Keep source files separate from exports. Developers should receive only the optimized files.
Exercise
A developer reports that [email protected] looks blurry on a high-density screen. Your export shows 120 × 40 pixels, and the logo is displayed at 120 × 40 CSS pixels. What went wrong and how do you fix it?
Show answer
The "2x" file has the same pixel size as the 1x display size, so it is not actually double. It should be 240 × 80 pixels. Re-export at 2x scale, confirm the dimensions with magick identify, and check in the browser that the intrinsic size is twice the rendered size.
Exercise
Rename Final Hero IMAGE v2.JPG (an 800-pixel-wide hero photo) so it follows the naming rules in this chapter.
Show answer
hero-800.jpg. It uses lowercase letters and hyphens, has no spaces, and the width marks the variant.