Background
Back to Blog

A Guide to Sizing Images for Websites

Altitude Design21 min read
A Guide to Sizing Images for Websites

Getting your website images right is one of those simple things that makes a massive difference. It's about finding that sweet spot between sharp, beautiful visuals and a tiny file size so your pages load in a flash. It’s a small bit of effort upfront for a huge boost in performance and a much happier audience.

Why Getting Image Sizing Right Is So Crucial

Think of your website like a physical shop. If you clutter the entrance with heavy, oversized boxes, customers are going to struggle to get in the door. It slows them down before they’ve even had a chance to look around. Online, that delay is measured in milliseconds, and every single one counts. Large, clunky image files are almost always the heaviest things on a webpage, making them the number one culprit for slow load times.

This isn’t just a minor tech issue; it directly impacts your bottom line. When a page takes an age to load, people lose patience and simply leave. This sends a clear signal to search engines like Google that your site offers a poor user experience, which can ding your rankings.

The Real-World Link Between Speed and Success

The relationship between how fast your page loads and how people behave is brutally simple. In the UK, just a one-second delay can lead to a 7% drop in conversions. Worse still, over half of visitors will abandon a site that takes longer than three seconds to appear. Given that images are often the biggest performance bottleneck, sorting them out can slash your total page weight by as much as 45%. You can read more about these crucial UK web design statistics to see the full picture.

This infographic lays out the direct financial cost of ignoring image optimisation.

Blog post image

As you can see, the path from a bloated image file to a lost sale is alarmingly quick. Each step compounds the last, turning what feels like a small technical oversight into a genuine business problem.

Mastering the Core Concepts

Thankfully, taking control of your images is straightforward once you get your head around a few key ideas. To make it easier, we need to be speaking the same language.

Key Image Sizing Terminology Explained

This table is a quick reference for the essential terms we'll be using. It’ll help you follow along, whether you're a complete beginner or just need a quick refresher.

TermWhat It MeansWhy It's Important
DimensionsThe width and height of an image, measured in pixels (e.g., 1200px by 800px).Determines how much physical space the image takes up on a screen. Using the right dimensions prevents the browser from having to waste time resizing a huge image.
ResolutionThe density of pixels, often measured in DPI (Dots Per Inch) or PPI (Pixels Per Inch).Crucial for print, but for the web, 72 PPI is the standard. Using a higher resolution for the web just adds unnecessary file size with no visual benefit.
File SizeHow much storage space the image file takes up, measured in kilobytes (KB) or megabytes (MB).This is the big one for performance. A smaller file size means a faster-loading page. Your goal is always to get this as low as possible without sacrificing quality.
CompressionThe process of reducing the file size of an image, either with (lossy) or without (lossless) a reduction in visual quality.Smart compression is how you dramatically shrink file size. It's the key to balancing speed and aesthetics.
File FormatThe type of image file, such as JPEG, PNG, WebP, or AVIF.Different formats are suited for different jobs. Choosing the right one (like WebP over JPEG) can offer better compression and features.

With these terms under your belt, you're ready to tackle the process head-on.

Your End-to-End Workflow

This guide will walk you through the entire process, giving you a repeatable workflow for perfect image management every time. You’ll learn how to:

  • Find the right dimensions: Pinpoint the exact pixel width and height you need for any image container on your site, taking all the guesswork out of it.
  • Choose the best file format: Understand when to use modern formats like WebP or AVIF instead of traditional ones like JPEG and PNG.
  • Apply smart compression: Learn how to massively reduce file sizes without anyone noticing a drop in visual quality.
  • Implement responsive images: Serve the perfect-sized image to every single device, from huge desktop monitors to the smallest mobile phones.
Treat image sizing not as a technical chore but as a core business strategy. It’s one of the highest-impact improvements you can make, leading to a faster, more engaging, and ultimately more profitable website.

Finding the Perfect Dimensions for Your Web Images

Blog post image

Before you even touch compression or file formats, you need to answer a deceptively simple question: how big should this image actually be? Guessing here is a classic recipe for disaster. Go too small, and your images look fuzzy and unprofessional. Go too big, and you're forcing users to download massive files for no good reason, grinding your site to a halt.

The goal is to find the largest possible size the image will ever be displayed on a screen and use that as your absolute maximum. This simple rule ensures crisp quality without adding a single unnecessary pixel of data. Forget generic advice like "make all blog images 1200px wide." Every single website layout is different, and the only way to know for sure is to look under the bonnet of your own site.

Using Browser Tools to Uncover the Truth

The most reliable method for sizing your images is already built right into your web browser. The "Inspect" tool (often called Developer Tools) lets you see exactly how your site is constructed, giving you precise, actionable data instead of vague guesses. It might look a bit intimidating at first, but it's your best friend for this job.

Here’s the straightforward workflow I use on pretty much any website:

  1. Head over to the page where your image will eventually live.
  2. Right-click on the space or placeholder where the image will go and select "Inspect" from the menu that pops up.
  3. A new panel will open, showing you the site's code. As you hover over different lines of code, you'll see the corresponding parts of the page highlighted.
  4. Your job is to find the container (usually a <div> or <section> element) that holds your image.
  5. With that container selected, glance over at the computed styles panel. It will show you the exact pixel dimensions of that space.

This simple technique reveals the maximum width and height your image needs to fill. For example, if you're inspecting a blog post layout, you might find the main content area is 800 pixels wide. That's your baseline. Sizing an image to 3000 pixels for an 800-pixel slot is just pure waste.

Planning for High-Resolution Screens

There's one crucial final step. Many modern devices, from iPhones to high-end laptops, have high-resolution screens (often marketed as "Retina" displays). These screens pack more pixels into the same physical space, which means a standard-resolution image can look ever-so-slightly soft.

To make sure your images are perfectly crisp on these devices, the best practice is to save them at 1.5x or 2x the display size you just found.

For an image container that is 800 pixels wide, you would export your final image at 1600 pixels wide (800 x 2). This provides the necessary detail for high-resolution displays while letting the browser scale it down perfectly for standard screens.

This "2x rule" is the secret to balancing brilliant visual quality with good performance. It's the standard I stick to for all client projects, whether we're talking about huge hero banners or tiny product photos.

Common Dimensions as a Starting Point

While inspecting your own site is always the best approach, it helps to have some general guidelines in mind. These are some common dimensions that tend to work well for many modern website layouts.

  • Full-Width Hero Image: Aim for a width of around 1920 pixels. This covers most standard desktop monitors without being ridiculously oversized.
  • Main Blog Post Image: These often land somewhere between 1000 and 1600 pixels wide, depending on whether your layout has sidebars.
  • eCommerce Product Photo: A square aspect ratio is very common here. 1080 x 1080 pixels is a great target as it allows for a decent zoom.
  • Small Thumbnail or Icon: These can be much smaller, often around the 150 x 150 pixel mark.

Think of these as starting points, not strict rules. Always let your website's actual layout be your final guide. By combining direct inspection with the 2x rule, you take all the guesswork out of sizing images. You’ll have a precise, repeatable method for choosing the perfect dimensions every single time, setting the foundation for a fast and visually stunning user experience.

Choosing the Right Image Format and Compression

Once you've nailed down the perfect dimensions, the next step is choosing the right file format and applying some smart compression. Think of this as the final polish before you put an image on your site. The format you choose dictates what the image can do—like have a transparent background—while compression shrinks its file size, making it much quicker for your visitors to download.

Getting this balance right is a game-changer. It’s the difference between a crisp, fast-loading visual and a blurry, slow-loading one that makes people click away in frustration. Modern image formats offer incredible efficiency, letting you slash file sizes without a noticeable drop in quality.

Decoding the Modern Image Formats

Long gone are the days when JPEG was your only real option for photos. Today, we have a handful of brilliant formats, and each one has its own strengths. Choosing the right one is simply about matching the format to the job at hand.

Here’s a quick rundown of your main options:

  • JPEG (or JPG): The absolute workhorse for photographs. It uses lossy compression, meaning it cleverly discards tiny bits of data the human eye won't miss to make the file much smaller. It’s ideal for complex images with lots of colours and gradients.
  • PNG: This is your go-to for graphics that need a transparent background. Think logos, icons, or illustrations where you need sharp lines and no blocky white box around them. It uses lossless compression, so no quality is lost, but this often means a larger file size than an equivalent JPEG.
  • WebP: Google's modern format that’s a fantastic all-rounder. It supports both lossy and lossless compression, as well as transparency and animation. A WebP image is often 25-34% smaller than a similar JPEG or PNG, making it a superb choice for almost any image on your site.
  • AVIF: The newest format on the block, offering even better compression than WebP. It can create incredibly small files while maintaining excellent visual quality. While its browser support is now very strong, it's the top choice when performance is your absolute priority.

This focus on efficiency is becoming more important than ever. As part of a move towards sustainable web design in the UK, agencies are now using aggressive compression to slash file sizes by up to 70%. This reduces server energy consumption and can improve page load times by 25%, showing a direct link between thoughtful image sizing and a better, greener web. You can find more insights about these UK business website design trends on highonrank.co.uk.

To help you decide at a glance, this table breaks down the key differences.

Image Format Comparison for Web Use

This table helps you quickly decide which image format is best suited for your specific needs by comparing key features and ideal use cases.

FormatBest ForKey FeaturesBrowser Support
JPEGPhotographs and complex, multi-coloured images.Excellent for photos, uses lossy compression for small file sizes. No transparency.Universal
PNGLogos, icons, and graphics with transparency.Supports transparent backgrounds, uses lossless compression so quality is high.Universal
WebPA versatile replacement for both JPEG and PNG.Offers both lossy and lossless compression, supports transparency and animation. Great balance of quality and size.Excellent (97%+)
AVIFWhen absolute top performance is critical.Provides the best compression available, resulting in the smallest file sizes.Very Good (94%+)

Each format has its place, but for most general use on a modern website, WebP is a fantastic and safe default choice.

The Art of Compression: Lossy vs Lossless

Compression is where the real magic happens. It’s how you take an image that's several megabytes (MB) and shrink it down to mere kilobytes (KB), massively speeding up your site. There are two main ways to go about it.

Lossless compression reduces file size without sacrificing a single pixel of data. It’s like perfectly packing a suitcase—everything is still in there, just organised more efficiently. PNG files use this method, which is why they're great for sharp graphics where every detail matters.

Lossy compression, on the other hand, permanently removes some data. It sounds drastic, but it’s done so intelligently that the visual difference is often impossible to spot. This is how JPEGs and WebP files achieve their tiny file sizes. You can usually control the level of compression, finding a perfect sweet spot between quality and size. For a deeper dive into performance, check out our guide on how to improve website speed.

The key takeaway is to embrace lossy compression for photographs. Don't be afraid to dial down the quality setting—a JPEG at 70% quality often looks identical to one at 100%, but with a file size that's a fraction of the original.

Finding the Sweet Spot with Squoosh

So how do you actually apply all this? While tools like Photoshop work perfectly well, one of the best and most user-friendly options is a free web app from Google called Squoosh. It lets you visually compare different formats and compression levels side-by-side in real-time.

You can upload your image, then use a slider to see exactly how different quality settings affect both the visual appearance and the final file size. It’s a brilliant way to learn and find that perfect balance for yourself.

Here’s a screenshot from Squoosh showing a direct comparison.

Blog post image

On the left is the original image. On the right is the optimised WebP version, which is over 90% smaller with almost no visible quality loss. This kind of instant visual feedback empowers you to make confident decisions about sizing images for websites, ensuring every graphic you upload is as lean and efficient as possible.

Making Your Images Responsive for Mobile Users

Blog post image

It’s not enough to just have a mobile-friendly layout. If you’re forcing a huge 1920-pixel desktop image down the line to a tiny smartphone screen, you’re just wasting a visitor's data and making them wait for a file they don't even need. This is a cardinal sin of modern web design, especially when mobile traffic is king.

The solution is using responsive images. This clever bit of HTML lets you offer up a menu of different-sized images, and the browser intelligently chooses the best one for the user's device. It's the secret to a genuinely fast and efficient mobile experience.

Getting to Grips with Srcset and Sizes

The magic behind responsive images comes down to two HTML attributes you add to your <img> tag: srcset and sizes. They work as a team, giving the browser all the information it needs to make the smart choice.

  • srcset (source set): This is your list of available image files, each paired with its actual width in pixels.
  • sizes: This tells the browser how much space the image will actually take up on the screen at different viewport sizes (or "breakpoints").

Let’s say you have a full-width hero image. You’ve already created three versions of it: a small 600px wide one, a medium 1200px one, and a large 1800px one.

Your HTML would look something like this:

Here, srcset lists our three image options. The 100vw in sizes tells the browser, "This image will always fill 100% of the viewport's width." Armed with this information, the browser can now download the smallest possible image that will still look crisp and clear.

A Practical Example for a Two-Column Layout

Let's get a bit more specific. Imagine a blog post where the main image sits in a content area that takes up 70% of the screen on large displays, but it switches to 100% width on any screen smaller than 800px.

Your sizes attribute needs to reflect this logic:

So what’s happening in that sizes attribute? The browser reads it from left to right and stops at the first condition that matches.

  1. (max-width: 800px) 100vw: If the screen is 800px wide or less, the image will fill 100% of the viewport width.
  2. 70vw: If that first condition isn’t met (meaning the screen is wider than 800px), this is the fallback. The image will take up 70% of the viewport width.

Getting this right isn't just a nice-to-have; it's a fundamental part of a strong mobile strategy. Page speed and user experience are massive ranking factors, making truly responsive images a cornerstone of successful mobile SEO best practices.

Think of srcset as your image menu and sizes as the instructions for which dish to order based on the size of the table. Getting the instructions right ensures every guest gets the perfectly portioned meal.

When You Need Art Direction with the Picture Element

Sometimes, just squishing a wide desktop image down isn't good enough for mobile. A sweeping landscape banner might look incredible on a big screen, but on a 360-pixel phone, the important details can get completely lost. This is where art direction comes into play.

The <picture> element gives you even more control. It lets you serve entirely different images—like a tight, vertical crop—for different screen sizes. This ensures your visual message is always clear and has an impact, no matter the device.

In this code, devices with a screen width of 600px or less will get the hero-portrait.jpg image. Larger screens will receive the full hero-landscape.jpg. That standard <img> tag at the end is a crucial fallback for older browsers that don't understand the <picture> element.

This approach is a core part of what is known as https://altitudedesign.co.uk/blog/what-is-responsive-web-design, ensuring the user experience is optimised from the ground up for every single device.

How Image Optimisation Impacts SEO and Accessibility

Getting your image sizes and compression spot on is the technical groundwork, but the real payoff comes when you connect that work to your bigger business goals—especially search engine optimisation (SEO) and web accessibility. An image is so much more than a pretty picture; it's a hard-working asset that can pull in search traffic and make your site more inclusive for everyone.

Thinking about images this way transforms the task from a simple box-ticking exercise into a core part of your digital strategy.

The link between smart image handling and your Google rankings is direct and measurable. Google’s mission is to give people the best, fastest results. Because massive images are one of the biggest culprits behind slow websites, they can directly drag down your position in the search results.

Boosting Your SEO with Smart Image Choices

Every single image you upload is a chance to send clear signals to search engines about what your page is about. It all starts with the filename. A default name like IMG_9876.jpg tells Google precisely nothing. Changing it to blue-leather-corner-sofa-dalkeith.jpg provides instant, keyword-rich context that helps your page show up for relevant searches.

The same idea applies to alt text (alternative text). Its main job is accessibility, which we'll get to in a moment, but it also gives search engines a written description of your visual content. A well-written alt text reinforces the page's topic and can help your images pop up in Google Image Search, creating another way for customers to discover you.

Remember, search engines can't "see" an image like a person does. They rely entirely on the text you provide—the filename, the alt text, and the content around it—to figure out what an image shows.

The wider strategy of image optimisation plays a significant role in both site speed and search engine rankings. For a deeper understanding, explore this comprehensive guide to image optimization for web performance.

The Critical Link to Core Web Vitals

Google uses a set of metrics called Core Web Vitals to measure the real-world user experience of a page. These vitals check a site's loading speed, how quickly you can interact with it, and its visual stability—and they are a confirmed ranking factor. Large, unoptimised images hit all three for six.

  • Largest Contentful Paint (LCP): This measures how long it takes for the biggest element on the screen (often a hero image) to load. A slow-loading image means a poor LCP score.
  • Cumulative Layout Shift (CLS): This tracks visual stability. If an image loads late and makes the content jump around, it creates a frustrating experience and a poor CLS score.

Properly sizing images for websites, therefore, isn't just a performance tweak; it's a direct investment in your SEO. UK-based SEO strategies increasingly recognise this, with 20% of technical SEO efforts focusing on on-page elements like image optimisation.

Making Your Website Accessible to Everyone

Beyond search engines, your image choices have a massive impact on people using screen readers and other assistive technologies. When it comes to images, alt text is the single most important tool for web accessibility. It provides a descriptive "caption" that's read aloud to users who can't see the image.

Writing good alt text is an art form. It needs to be descriptive but concise.

  • For an informative photo: Instead of alt="sofa", write alt="A three-seater corner sofa in navy blue leather with light oak feet."
  • For an image that is also a link: The alt text should describe what happens when you click, like alt="Read our guide on choosing a new sofa."
  • For decorative images: If an image is purely for decoration and adds no real information, you can use an empty alt attribute (alt=""). This tells screen readers to skip right over it.

By crafting thoughtful alt text, you ensure every visitor, regardless of their ability, can understand and navigate your content. This commitment to inclusivity not only builds goodwill but also creates a better, more robust website for everyone. Ultimately, these practices are essential if you want to learn how to increase website traffic through both technical excellence and a user-first approach.

Common Questions About Sizing Web Images

Even when you have a solid workflow, certain questions always seem to crop up right when you’re in the middle of a project. This is where we tackle those common head-scratchers with quick, practical answers to get you unstuck and back on track.

Think of this as your go-to reference for those "what about..." moments. We'll run through some of the most frequent queries I hear from clients, reinforcing the core ideas we've covered with direct, actionable advice.

What Is the Best Resolution for Web Images?

This is a classic point of confusion, especially for anyone coming from a print background where DPI is king. For the web, DPI (Dots Per Inch) or PPI (Pixels Per Inch) is almost entirely irrelevant. Your entire focus should be on the pixel dimensions – the actual width and height of the image.

The long-standing web standard is 72 PPI. While modern screens can handle much more, saving an image at a higher resolution like 300 PPI offers absolutely no visual benefit on a screen. All it does is bloat the file size for no good reason. Stick to 72 PPI and pour your energy into getting the pixel dimensions and compression spot-on.

How Should I Size Full-Screen Background Images?

Full-screen backgrounds are tricky. They need to look sharp on everything from a standard laptop to a massive 4K monitor. Go too small and you get a blurry, unprofessional mess; go too big and you’ll seriously slow your site down.

A safe and effective size for most full-screen background images is 1920 pixels wide by 1080 pixels tall. This 16:9 aspect ratio covers the vast majority of desktop screens perfectly. You could push it to 2560 pixels wide for the ultra-high-res crowd, but you absolutely must compress the file aggressively to keep the file size under control.

The real secret with background images is aggressive compression. Because they often sit behind text and other elements, you can usually get away with a much lower quality setting than you could for a main product photo. This can slash the file size with no noticeable impact.

Do I Really Need to Use WebP or AVIF?

While good old JPEGs and PNGs are universally supported, modern formats like WebP and AVIF offer a serious performance boost. A WebP image can be 25-34% smaller than its JPEG equivalent with no visible drop in quality. That translates directly into faster page load times.

Global browser support for WebP is now over 97%, making it an incredibly safe choice for almost any audience. So while you don't have to use it, choosing not to is basically leaving free performance gains on the table. For any new project, making WebP your default format is a smart, modern move.

Can I Automate the Image Optimisation Process?

Absolutely. Manually resizing, compressing, and creating multiple versions of every single image is a massive time sink, especially on image-heavy sites like blogs or online stores. Thankfully, plenty of tools can handle the heavy lifting for you.

  • Content Management Systems (CMS): Platforms like WordPress have brilliant plugins (think Smush or Imagify) that automatically compress images on upload and can even generate responsive srcset versions for you.
  • Static Site Generators: Many modern web development tools have image processing baked right into their build pipelines, handling everything automatically when you deploy your site.
  • Third-Party Services: Services like Cloudinary or Imgix can host your images and deliver them perfectly optimised and sized for any device on the fly, completely removing the manual workload.

Automating the process not only ensures consistency but also frees you up to focus on creating great content, safe in the knowledge that your images are always perfectly sized and optimised.

At Altitude Design, we build custom, hand-coded websites where performance is paramount. We handle every aspect of image optimisation—from sizing and compression to responsive implementation—ensuring your site loads lightning-fast and looks stunning on every device. Get a professional, high-speed website that drives results by visiting https://altitudedesign.co.uk.

Share this article