Screpy - AI SEO Audit Tool

Image Aspect Ratio: Fix Distorted Images and Layout Shifts

Fix images displayed at the wrong proportions, reserve layout space, and use responsive CSS without stretching visual content.

Reviewed by Screpy Editorial Team

What an incorrect aspect ratio means

An image has an incorrect displayed aspect ratio when its rendered width and height do not preserve the proportions of the source file. A 1200 by 800 image has a 3:2 ratio. Forcing it into a square without intentional cropping stretches or compresses the visual.

This problem can make product images, screenshots, logos, and faces look distorted. Missing dimensions can also prevent the browser from reserving space before an image loads, contributing to Cumulative Layout Shift.

Choose the intended behavior

There are two valid outcomes:

  • Preserve the complete image. Keep width and height proportional and allow one dimension to calculate automatically.
  • Crop the image into a designed frame. Give the frame a ratio and use object-fit: cover so the image is cropped rather than stretched.

Do not force both dimensions to values that conflict with the source ratio unless distortion is an intentional effect.

Preserve the full image

<img src="dashboard.png" width="1200" height="800" alt="Screpy website audit dashboard">
img {
  display: block;
  max-width: 100%;
  height: auto;
}

The width and height attributes communicate the intrinsic ratio. Responsive CSS can still scale the image while preserving that ratio.

Crop into a fixed design

.thumbnail {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
}

Use a focal-position rule when the important part of an image would otherwise be cropped. For logos and diagrams, contain is often safer than cover.

Responsive image checks

  1. Confirm that every srcset candidate represents the same composition and ratio unless art direction is intentional.
  2. When using the picture element for art direction, provide dimensions or ratio information for each source.
  3. Test the smallest and largest container widths.
  4. Check lazy-loaded images because a missing placeholder size can create a shift later in the page.
  5. Verify CSS from parent components; fixed heights, grid rows, and inherited object-fit rules often cause the distortion.

SVG, background, and generated images

SVG files should have a useful viewBox. CSS background images use background-size instead of object-fit. Generated thumbnails should be created at the final intended ratio where possible, which reduces unpredictable cropping and unnecessary bytes.

How to verify the fix

Compare the intrinsic and rendered dimensions in browser developer tools. Resize the viewport, confirm that the subject is not stretched, and run a layout-shift check. The web.dev guide to optimizing Cumulative Layout Shift explains why image dimensions and reserved space matter.

Related tasks

Solve the errors logged to the console

If there are error warnings about your website within the console offered by the browser, you need to follow a few basic steps to resolve them.

Tuesday, December 22, 2020

Title Tags Not Found

Are you encountering the title meta tag not found the issue? You can solve it right away! Here are the causes and importance of the problem in detail.

Sunday, December 20, 2020

Robots.txt Not Found

If you are encountering the Robots.txt not found error, you can create your file immediately by paying attention to the steps below. Discover the details now!

Sunday, December 20, 2020

Not Crawlable Pages

Have the same problem with crawlability issues? Let’s see what you can do for your website to be indexed. Here are the ways and solutions!

Sunday, December 20, 2020

Meta Description Not Found

Are you getting a meta description not found a warning about your web page? Let's figure it out! Why is meta description important, how to pass the audit? Examine!

Sunday, December 20, 2020