Web-Ready Images: Graphic File Size and Format (2024)

By Linda Warren|||

Web-Ready Images: Graphic File Size and Format (1)Graphic file size and format are topics that did not interest me when I started using software to create and manipulate images for the web. However, a little bit of experience demonstrated the need for some basic understanding of factors related to the way my images displayed on a computer monitor. The smaller the file size, the faster the image loads in a browser. When I create online training, I want pages to load as fast as possible. Optimizing images for the web is the subject of this blog posting.

Estimated reading time: 8 minutes

File Size

Have you ever left a website because it took too long for images to load? I have, and I don’t want people taking my training to sufferthrough long download times. That’s why I make graphic file sizes as small as possible—so images load quickly. There are three simple things you can do to minimize the file size.

  1. Set the image resolution to 72 dpi. Make sure your graphics are at an appropriateresolution for web browsers—72 pixels per inch (ppi). The unit of measure is more commonly referred to as dots per inch (dpi). Standard monitor resolution is 72 or 96 pixels per inch so it is a waste to have your image resolution higher.
  2. Limit the number of colors. As you might guess, file size has a direct relationship to color depth. (For more information on color depth, read Pixels and Online Training.) Image files with lots of colors, gradients, and subtle transitions are large compared to files with solid and few colors. If you want an image to load quickly and subtle color variations are unimportant, you can limit file size by using the indexed color model (explained in Color Models) where the number of color options are limited to 256.
  3. Reduce image dimensions. Another thing you can do is reduce the dimensions of your graphic images. You can have a small version of a diagram load initially and provide a link to open a larger version when a user wants to see more details.

Beyond taking these steps to minimize file size, you also need to consider file format.

File Format

When you create or edit images in a graphics application, you have the option to save the file in the application’s native format. Saving a file in the native format preserves all data. In the case of graphic files, saving in the native format preserves layers—an important functional aspect of the file. When you are ready to place the file on a web page, you need to save it in a format that a web browser can recognize. For example, if you want to place an Adobe® Photoshop file on a web page, you need to save the Photoshop file in a format other than Photoshop’s native .psd. Graphic files can be saved in a variety of cross-platform formats.

The letter code after the dot (.) in a file name provides information to a computer about the file format.

Examples
File typeFormat code
Word.doc or .docx
Spreadsheet.xls
Encapsulated PostScript.eps
Most commonly used graphic file formats for the web
Format nameFormat code
Joint Photographic Experts Group.jpg
Graphics Interchange Format.gif
Portable Network Graphics.png

Saving a file as a JPG, GIF, or PNG compresses the original file and reduces the file size, but not the image dimensions. This compression is what we want for faster downloading.

The three graphic file formats used most commonly for the web serve different purposes. Let’s look at the implications of selecting a particular format type.

JPG

JPG (pronounced jay peg) is an appropriate file format for images with gradients, subtle transitions, or many colors (e.g., photographs). When you save an image as a JPG, the graphics application compresses the native file by selectively discarding data. This is known as “lossy” compression, which causes some image quality to be lost. Decrease in image quality is not very noticeable unless you enlarge the image.

Web-Ready Images: Graphic File Size and Format (2)When you save an image as a JPG, the application gives you the ability to make adjustments.

“Image Options” specifies image quality, which in turn determines image size.

“Format Options” deal with the way your file is saved and how it loads in a browser. Baseline (“Standard”) is the default option. Baseline Optimized creates a file with optimized color and a smaller file size. Progressive tells a web browser to load the image incrementally.

Web-Ready Images: Graphic File Size and Format (3)This JPG image is shown at 200% scale. JPG compression is high quality—12. The file size is 187.2k.

Web-Ready Images: Graphic File Size and Format (4)

This JPG compression has a lower quality—4.

The file size is 64.2k.

It is difficult to see any difference in image quality compared to the less compressed version above.

JPG format is not appropriate for images made of large areas of solid color.

GIF

GIF (pronounced giff) is an appropriate format for images with sharp edges and large areas of solid color, such as logos and diagrams. It is also appropriate when you want transparency in your file. When you save an image as a GIF, the graphics application uses “lossless” compression, meaning the image does not lose quality. GIF files are restricted to 256 colors, but many GIFs have far fewer colors.


Web-Ready Images: Graphic File Size and Format (5)Many GIFs (such as the logo on the left) are created in a vector-based application, such as Adobe® Illustrator.

Web-Ready Images: Graphic File Size and Format (6)When an Illustrator file is saved as a GIF, the Color Table displays the colors in your file. You can select one color to be transparent.

Web-Ready Images: Graphic File Size and Format (7)The gray and white check boxes in the background indicate the transparent areas.


Web-Ready Images: Graphic File Size and Format (8)When a GIF with transparency is placed over a background (such as a yellow gradient), you see the background in the transparent areas.

The limited GIF color palette makes this format inappropriate for photographs.

PNG

PNG (pronounced ping) is a newer and versatile file format for web graphics. The PNG format can be used for either limited color files such as those using an indexed color model with a maximum of 256 colors or the format can be used for full color images with millions of colors. PNG uses a “lossless” compression scheme, meaning no data is lost when the file is saved.

PNG files allow transparency, but unlike GIFs, PNGs have a variety of transparency options and allow up to 256 levels of transparency.

Another benefit of PNG files is built-in gamma correction capability. Gamma correction allows an image to take into account a monitor’s brightness and adjust the PNG image on the monitor to display the image’s intended brightness.

On large files with limited color and sharp edges, PNG compression is greater than GIF. However, GIF compression is greater than PNG on small files.

JPG compression can produce a smaller file of a photograph than PNG compression because the JPG lossy encoding method is more efficient than PNG’s lossless compression.

The PNGfile format is not supported on older browsers. In particular, versions of Internet Explorer below 9.0 on Windows systems have many problems that prevent browsers from rendering PNG images correctly.

Wrap up

The format you choose for a graphic file is determined in part by the nature of the graphic and in part by what you want to achieve. File size and color richness are the two major considerations.

This article provides a brief overview about preparing graphics for the web.

For additional information, visit the Web Style Guide by Patrick J. Lynch and Sara Horton or read The Non-Designer’s Web Book by Robin Williams and John Tollett.

Related posts:

  • Technical Considerations: Pixels and Online Training
  • Technical Considerations: Color Models

Looking for more information on web-based training? Linda has developed a series on converting instructor-led training to web-based training called Great Voyages. The slide decks from all five presentations are available for download.

Related Posts

Color Models
Interactive Graphics
Pixels and Online Training

Contact our Learning Developers

Need to discuss developing e-learning? Creating curriculum for classroom training? Auditing and remediating e-learning for accessibility? Our learning developers would be glad to help.

Web-Ready Images: Graphic File Size and Format (2024)

FAQs

Web-Ready Images: Graphic File Size and Format? ›

Ideally all images will be under 300kb in file size, but if a file needs to be in png format, under 500kbs may be the best you can do. This file size applies to complete images, like a finished blog header, not to the individual images that go into creating a header.

What file size should website images be? ›

Best image size for websites

File size: Anything bigger than 20 megabytes in size can dramatically impact your website speed. Smaller images (up to two megabytes in size, but around 500 kilobytes) are better in most cases.

What file format is best for web images? ›

Photos should use a JPG file format whereas logos and simple illustrations should use PNG or SVG files. Keep in mind, JPG and PNGs can also have the same quality and smaller file size with the lesser-known format, WebP.

What size should images be optimized for web? ›

How to Optimize Images for the Web
  • Benchmark your current site speed.
  • Know how to choose the best image file type.
  • Resize your images before exporting.
  • Compress images to reduce file size.
  • Automate image optimization with a WordPress plugin.
  • Use the “blur up” technique to load a Lower Quality Image first.
Aug 31, 2023

What file format would be appropriate for web graphics? ›

There are three file formats for graphics used on the web: JPG, GIF, and PNG.

How do I make an image Web ready? ›

You can perform a lossless compression on your desktop using tools such as Photoshop, FileOptimizer, or ImageOptim. It's best to experiment with your compression techniques to see what works best for each image or format. If your tools have the option make sure you save the image for web.

How many MB is a good quality photo? ›

This can vary depending on your file format, but in general anything over 3.5 megabytes (MB) would be classed as a high-resolution image.

What is the highest quality image for web? ›

PNG: The High-Quality Web Image Format

PNG stands for Portable Network Graphics, a raster image format supporting lossless compression. This means it compresses the image data without discarding any information, so the image quality remains intact.

What are the 4 types of image formats? ›

Common image file types
AbbreviationFile formatFile extension(s)
JPEGJoint Photographic Expert Group image.jpg , .jpeg , .jfif , .pjpeg , .pjp
PNGPortable Network Graphics.png
SVGScalable Vector Graphics.svg
WebPWeb Picture format.webp
3 more rows
Mar 27, 2024

Is PNG or JPEG higher quality for web? ›

If you need high-quality, lossless images — particularly for digital graphics, logos, and web design elements — then use a PNG! This format is also excellent for images that need to be partially transparent or if you plan on doing multiple edits, as the format doesn't lose quality with multiple saves.

What is the best resolution for a website? ›

Here are several reasons why 1920 x 1080 may be the best resolution for web design: 1920 x 1080 is a resolution that is widely supported by modern computer monitors, laptops, and even mobile devices. This means that your website will look good on a wide range of devices.

How do I optimize an image for loading on my website? ›

Optimize your images
  1. Choose the right image format.
  2. Choose the correct level of compression.
  3. Use Imagemin to compress images.
  4. Replace animated GIFs with video for faster page loads.
  5. Serve responsive images.
  6. Serve images with correct dimensions.
  7. Use WebP images.
  8. Use image CDNs to optimize images.

How do I compress a high resolution image? ›

How to compress photos in Adobe Photoshop Lightroom.
  1. Open your photo in Lightroom.
  2. Go to File > Export.
  3. In the Export menu, choose JPG as your file type.
  4. Change the dimensions and quality to reduce the size of your file. ...
  5. Click the blue Export Photo button and choose where you want to save your compressed file.

What are the 4 graphics formats commonly used on the Web? ›

Common Image File Formats
  • TIFF (. tif, . tiff) ...
  • GIF (. gif) GIF or Graphics Interchange Format files are widely used for web graphics, because they are limited to only 256 colors, can allow for transparency, and can be animated. ...
  • PNG (. png) ...
  • EPS (. eps) ...
  • RAW Image Files (. raw, .
Apr 10, 2024

Which picture format does not lose quality? ›

TIFF - Tagged Image File

A TIF is a large raster file that doesn't lose quality. This file type is known for using "lossless compression," meaning the original image data is maintained regardless of how often you might copy, re-save, or compress the original file.

What is the best image format for Web 2024? ›

Photos and complex images usually look better with JPG, WebP, or AVIF files, while logos and simple graphics usually look better with PNG, SVG, or WebP files. Animations and transparent images usually look better with GIF, PNG, WebP, or AVIF files.

How many MB should a website be? ›

The average optimal weight per page is approximately 1–1.5 MB, but in general, this value should not exceed 3 MB. The use of heavy content such as video, photos, and various special effects should be justified. Add large volumes of information only if it is useful to the reader.

Why does image file size matter on a website? ›

File size is also key to why image size matters in web design. Each time a new visitor reaches your website, the data that forms the images and text needs to be downloaded from the internet and onto the viewer's screen. This means the larger the file size, the longer the loading will take.

Top Articles
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 6218

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.