A beginner's guide to JPEG files

black floor lamp at the corner

If you've ever published content on the web, chances are you've a) used a JPEG and b) not known much about what a 'JPEG' actually is.

Here's the potted summary: JPEG files are a type of raster image file format that is used to store images. JPEGs are popular because they can store a lot of data in a small file size, which makes them ideal for everything from digital photos to web graphics.

Want to know more, but aren't quite ready to read detailed technical documentation? You're in the right place.

In this guide, we'll cover:

Publish three free stories with Shorthand.

Build stunning, interactive web content for free. No code, no credit card, and no commitment required.
Get started.

What is a JPEG file?

black floor lamp at the corner

JPEG files (or JPG files) are a type of raster image file format that uses compression to store data, and has the file extension .jpg. This compression allows for smaller file sizes, which makes them ideal for use on the web. JPEGs are also used for printing, as they can produce high-quality images while still keeping the file size relatively small.

How does JPEG compression work? JPEG image compression works by splitting an image into small squares and then compressing each square individually. This makes JPEG image files very efficient at compressing images with areas of solid colour, like photos.

JPEG compression does not work well on images with sharp edges or large areas of uniform colour, like line drawings or logos. These types of images often appear blocky or fuzzy when they are compressed as a JPEG.

Generally, however, JPEG compression is very effective and most people don't notice the difference between the original image unless they are actively looking for them.

There are two variants of JPEGs that you might also have heard of.

Exchangeable image file format (EXIF) is a specification for a JPEG-based file format for images, audio, and video. EXIF data is embedded in JPEG images and contains information about the camera that took the picture, as well as GPS location data, which can be used to determine the picture's origin.

The JPEG File Interchange Format (JFIF) is a JPEG-based file format for images. JFIF files are often used in digital cameras. That's because they can be compressed to much smaller file sizes than other types of image files.

Learn more about other image file formats.

A brief history of the JPEG

black floor lamp at the corner

In the early days of digital photography, images were often stored as Bitmap BMP files, which were large and took up a lot of storage space. To solve this problem, a group of experts invented the JPEG format.

The JPEG standard file type was created in 1992 because there was a need for a standardised image format that could reduce the file size of digital images while still retaining image quality.

JPEGs offered a smaller file size that was more manageable, and they soon became the standard format for digital photography. With the rise of smartphones, there are likely trillions (with a 't') of JPEG files in the world today.

The JPEG standard was created in 1992 by the Joint Photographic Experts Group, or JPEG. JPEG is a committee made up of experts from a variety of industries, including photography, graphic design, and software development.

The JPEG standard is managed by the International Organization for Standardization (ISO), which is an international standards organisation. For the extremely curious, the JPEG standard is also known as ISO/IEC 10918-1.

The benefits of JPEG files

black floor lamp at the corner

The JPEG file format is typically smaller in file size than other image formats.

This is because JPEGs are compressed, meaning that they remove some of the data from the image that is not essential for displaying it. This makes JPEGs less accurate than other image formats, but it also means that they take up less space on your device or on the internet

JPEGs compression is very effective for most use cases.

For most people, JPEGs offer the best of both worlds — they are smaller in size, while still retaining image quality. This is because JPEGs remove some of the data from the image that is not essential for displaying it, while other image formats do not compress their files as much.

JPEGs are supported by most web browsers.

They can also be displayed on a wide variety of devices. This makes them a good choice for posting images online, as most people will be able to see them no matter what type of device they are using.

JPEGs can be easily converted to other file formats.

This includes PNG or GIF. This is useful if you want to save an image in a different format, or if you need to use a JPEG in a program that does not support them.

The disadvantages of JPEGs

black floor lamp at the corner

JPEG compression can sometimes result in artifacts.

These are visible blocks or lines on the image. This is because JPEG compression removes some of the data from the image, and this data might be important for displaying the image correctly. For this reason, JPEGs are not well suited for images with sharp edges or large areas of uniform colour.

JPEGs can be difficult to edit.

This is because the quality of the image can be reduced if the file is compressed too much.

JPEGs are not well suited for transparent images.

This is because JPEGs use a lossy compression algorithm, which means that the image is compressed using a mathematical formula that results in some data being lost. This can cause problems with transparent images, as the compression algorithm can sometimes “mix” the colours of the transparent pixels with the colours of the background pixels, causing a blurry or distorted effect.

What are JPEGs used for?

black floor lamp at the corner

Web images

The main use case for JPEG files is web images. This is because they can be compressed to much smaller file sizes than other types of image files. This makes them load faster on websites. JPEG files are also often used for email attachments because they are small enough to send quickly.

Digital cameras

JPEGs are often used in digital cameras because — again — they can be compressed to much smaller file sizes than other types of image files. This reduces the amount of storage space needed for images.

How to open, edit, and convert a JPEG

black floor lamp at the corner

How to open a JPEG

To open a JPEG file or either a Microsoft or Mac operating system, you will need an app that supports JPEGs. Most web browsers support JPEGs, as do most photo editing programs and image viewers, such as Adobe Photoshop and Preview.

How to edit a JPEG

JPEG files can be edited using a variety of editing software programs, such as Photoshop, GIMP, or Paint.NET. But remember, JPEGs should not be compressed too much when they are being edited, as this can reduce the quality of the image.

How to convert a JPEG

If you want to convert a JPEG to a different file format, such as PNG or GIF, you can use a program like Photoshop or GIMP, and simply ‘Save As’ your chosen file type. These programs allow you to convert JPEGs to other formats, and they also offer options for adjusting the quality of the JPEG image.

Alternatively, you can use an online JPEG converter. These websites allow you to upload JPEG images and convert them to other formats, such as PNG or GIF. Some of these websites also offer options for adjusting the quality of the JPEG image.

What's the difference between a JPEG and a PNG?

black floor lamp at the corner

JPEGs are often used for web images because they can be compressed to much smaller file sizes than other types of image files. This makes them load faster on websites and reduces bandwidth costs for website owners. JPEGs are also often used for email attachments because they are small enough to send quickly.

PNGs, on the other hand, are not as compressed as JPEGs, so they tend to produce larger file sizes. However, because PNGs use lossless compression, they do not suffer from the artifacting problems that JPEGs sometimes do, and they are better suited for transparent images. Also, PNGs are more easily edited than JPEGs.

Read our guide to PNG files.

What's the difference between a JPG and a GIF?

black floor lamp at the corner

JPEGs are often used for web images because they can be compressed to much smaller file sizes than other types of image files. This makes them load faster on websites and reduces bandwidth costs for website owners. JPEGs are also often used for email attachments because they are small enough to send quickly.

GIFs, on the other hand, are not as compressed as JPEGs, so they tend to produce larger file sizes. However, GIFs do not suffer from the artifacting problems that JPEGs sometimes do, and they are better suited for transparent images.

What's the difference between a JPG and a TIFF?

black floor lamp at the corner

JPEGs and TIFFs are both image file formats, but they have different features. JPEGs are compressed files that are often used for web images and email attachments.

TIFFs are less compressed than JPEGs, so they tend to produce larger file sizes. However, TIFFs do not suffer from the artifacting problems that JPEGs sometimes do. As with PNGs, TIFFs are more easily edited than JPEGs.

Conclusion

black floor lamp at the corner

That's our beginner's guide! Let us recap our main points:

  • JPEGs are a type of image file that is commonly used on the web.
  • JPEG compression means that they can be stored in smaller file sizes than other types of image files.
  • JPEGs can sometimes suffer from artifacts, or visual distortions, due to the compression algorithm.

If you have any questions you think should be covered in this guide, let us know. Otherwise, check out our guide to other image file formats.