Tag Archives: web

JPEG what? A user guide to understanding JPEG

JPEG 101: A Crash Course Guide on JPEG

JPEG, a compression algorithm optimized for photographic images, is something we encounter on a regular basis. JPEG is not limited to a certain amount of color (unlike GIF, for example) and is popular due to its variable compression range, meaning that you’re able to more easily control the amount of compression, and consequently, the resultant image quality. In this guide, we will discuss the important things you need to know about JPEG.

 

Quick Overview of JPEG

Here is a list of things you should know about JPEG:

  • JPEG is a lossy compression algorithm; this means that it discards some data from an image to reduce its file size
  • JPEG is often pronounced as “jay peg”
  • JPEG is an acronym for Joint Photographic Experts Group, the organization that developed the JPEG format
  • .jpg and .jpeg are the most common file extensions of images compressed using JPEG compression algorithm; they are the same, but old DOS systems have a 3-character limit on file extensions — modern operating systems recognize both .jpg and .jpeg
  • Other file formats that use the JPEG compression algorithm are .jpe, .jfif and .jif

Semantics and Disambiguation: JPEG vs. JFIF/Exif

Many people refer to any image format that uses the JPEG compression algorithm as a “JPEG file.” However, most image-capturing devices (such as a digital camera) and image-editing programs actually create a file in the JFIF or Exif format. For all intents and purposes, when people say “JPEG file” or when a software application says they’re saving your work in JPEG, you can just think of it as a file that uses the JPEG algorithm, whether it’s really JFIF or Exif.

Why Use JPEG?

JPEG allows you to control the degree of “lossiness” by adjusting compression parameters. This way, you can achieve very small files with just the minimum amount of quality that you really need.

The second important advantage of JPEG is that it stores full color information: 24 bits per pixel (that means 16 million colors). GIF, another image format widely used on the web, can only store 8 bits per pixel (256 colors). This capacity for storing colors is why JPEG compression is great for displaying images that have rich colors and that are photographic in quality.

JPEG Compression

Opposite to the PNG format (which uses a lossless compression algorithm), JPEG uses a lossy compression method.

Lossy compression reduces the image size by discarding information. Think of lossy compression as an excellent book summary of just the important and interesting parts of a book you’re reading. For example, you could summarize a book that’s long-winded and redundant in prose, to just a page worth of notes containing only the information that’s really important.

The problem, then, is when you want to recreate the original book from your one-page book summary; it wouldn’t be possible.

The other problem is that if you continue to summarize the book summary again, then you’ll lose more fidelity and accuracy from the original book.

With lossy compression, compressing an image again means losing more data, which means reduced image quality.

Baseline JPEG vs. Progressive JPEG

JPEG come in two flavors: baseline and progressive. Baseline JPEG is an image created using the JPEG compression algorithm that will start to display the image as the data is made available, line by line. In a web browser, you can see JPEG images that are in baseline format when you see it slowly showing up, from the top of the image, to the bottom of it.

Progressive JPEG displays an image in such a way that it shows a blurry/low-quality photo in its entirety, and then becomes clearer as the image’s data becomes more fully downloaded.

Baseline JPEG vs. Progressive JPEG

Progressive is good because the user gets an idea of what the image will be right from the start, even though it’s not as clear as the final image, which is great especially for people with slower Internet connections. The progressive JPEG format also enhances perceived web page performance because it doesn’t appear to be loading in increments, unlike baseline.

JPEG Baseline/Progressive Format in Photoshop

When you use Photoshop’s Save As feature (File > Save As) to output your work in JPEG format, you will be presented with the following Format Options:

JPEG Baseline/Progressive Format in Photoshop

  • Baseline: the image will be displayed line by line on the screen
  • Baseline Optimized: Same as Baseline, but optimized further using Huffman coding
  • Progressive: You can specify 3-5 scans, meaning that it will have between 3-5 phases before it shows the final image

When to Use JPEG

Photographic images that are rich/high in color are where JPEG compression is most suited.

Use JPEG when you want better/easier control of the amount of compression that you want to use for your images. This helps you in in maximization for small file size versus quality.

When JPEG Should Be Avoided

The JPG algorithm isn’t good for images with sharp edges such as text, cartoon drawings, and so forth. You should choose PNG or GIF for such images.

Also, when you have files that are simple in color, such as logos, icons, favicons, and vector drawings, you will get lower file sizes and the same (or better) quality as JPEG. To learn more about JPEG vs. PNG/GIF, read the Web Designer’s Guide to PNG Image Format.

When JPEG Should Be Avoided

Saving JPEGs in Photoshop

The following shows a comparison of the same image saved in various levels of JPEG compression.

Original
Original, file size: 23.2 KB Very High, file size: 21.8KB
High, file size: 14.6 KB Medium, file size: 6.73 KB
Low, file size: 3.78 KB 0 quality, file size: 2.72 KB

JPEG Compression Under the Microscope

Here are the micro-differences of a zoomed-in, 8x8px area of the image above, from original to lowest quality:

Is Transparency Using JPEG Possible?

JPEG does not currently support traditional transparency. If you need transparency, such as when you are setting an image on top of another and want to allow the background to show through it, you should use a compression algorithm that supports transparency, like PNG or GIF.

Here is a simulation of JPEG vs. PNG transparency:

simulation of JPEG vs. PNG transparency

WebP: A New Image Format That Rivals JPEG

WebP is a new image format that provides lossy compression for photographic images, just like JPEG. A while ago, Google announced the WebP (pronounced “weppy”) graphics format along with its research. The research indicates that using it could cut image file sizes by 40% compared to the dominant JPEG file format. This means faster file transfers and reduced network burden.

As many web browsers don’t support it (yet), it’s currently ineffective for web use. Read more about WebP.

Practical Tips for Using JPEG

  • Use Smush.it as a further optimizing tool for your JPEGs; it’s a lossless optimizer, so quality is retained
  • To achieve lossless editing of JPEG files (such as cropping or rotating), you can use Jpegtran
  • If you’re looking for a good alternative to the JPEG format, then PNG-24 is a good alternative; it will have a bigger file size for photographic images, but it uses a lossless compression
  • If a JPEG image is opened, edited, and saved again, it results in additional image degradation, so when you’re editing an image in multiple sessions, save the intermediate image in an uncompressed/raw format such as TIFF or the editing software’s native format (e.g. .psd for Adobe Photoshop or .psp for PaintShop Pro)

Great article by: Catalin Rosured-team-design.com, @catalinred.

First impressions | websites with visual impact

Remember when you dated, or maybe you’re dating now? How crucial is the first impression? For many this determines how the rest of the date will proceed. We have all been there preparing to look our best before we meet our date. The goal is to impress the other person and to keep their attention on you. But do we apply this same principle to our business?

Take a second and go look at two of our recent websites we did for K & J Trucking and Omega Maiden

  

Like the look of these websites? Whatever the answer (and hopefully it was yes), the chances are you made your mind up within the first twentieth of a second. A study by researchers in Canada has shown that the snap decisions Internet users make about the quality of a web page have a lasting impact on their opinions.

We all know that first impressions count, but this study shows that the brain can make flash judgements almost as fast as the eye can take in the information. The discovery came as a surprise to some experts. “My colleagues believed it would be impossible to really see anything in less than 500 milliseconds,” says Gitte Lindgaard of Carleton University in Ottawa, who has published the research in the journal Behaviour and Information Technology1. Instead they found that impressions were made in the first 50 milliseconds of viewing.

Lindgaard and her team presented volunteers with the briefest glimpses of web pages previously rated as being either easy on the eye or particularly jarring, and asked them to rate the websites on a sliding scale of visual appeal. Even though the images flashed up for just 50 milliseconds, roughly the duration of a single frame of standard television footage, their verdicts tallied well with judgements made after a longer period of scrutiny.

In the crowded and competitive world of the web, companies hoping to make millions from e-commerce should take notice, the researchers say.

“Unless the first impression is favorable, visitors will be out of your site before they even know that you might be offering more than your competitors,” -Lindgaard

First impressions

For a typical commercial website, 60% of traffic comes from search engines such as Google, says Marc Caudron of London web-design agency Pod1. This makes a user’s first impression even more critical, he explains.

“You’ll get a list of sites, click the top one, and then either say ‘I’ve engaged’ and give it a few more seconds, or just go back to Google,” he says.

The lasting effect of first impressions is known to psychologists as the ‘halo effect’: if you can snare people with an attractive design, they are more likely to overlook other minor faults with the site, and may rate its actual content (such as this article, for example) more favorably.

This is because of ‘cognitive bias’, Lindgaard explains. People enjoy being right, so continuing to use a website that gave a good first impression helps to ‘prove’ to themselves that they made a good initial decision. The phenomenon pervades our society; even doctors have been shown to follow their initial hunches, Lindgaard says, relying heavily on a patient’s most immediately obvious symptom when making a diagnosis. “It’s awfully scary stuff, but the tendency to jump to conclusions is far more widespread than we realize,” she says.

Beauty and beholder

So what are the key ingredients of a good-looking website? Caudron suggests that the amount of graphics on the page should be strictly limited, perhaps to a single eye-catching image. “It’s not about getting as much stuff on the page as possible,” he says.

These days, enlightened web users want to see a “puritan” approach, Caudron adds. It’s about getting information across in the quickest, simplest way possible. For this reason, many commercial websites now follow a fairly regular set of rules. For example, westerners tend to look at the top-left corner of a page first, so that’s where the company logo should go. And most users also expect to see a search function in the top right.

Of course, says Caudron, the other golden rule is to make sure that your web pages load quickly, otherwise your customers might not stick around long enough to make that coveted first impression. “That can be the difference between big business and no business,” he says.

This week I want to challenge you to do 3 things:

  1. Go look at your website, and write down 5 things you like and 5 things you dislike.
  2. Ask 3 people to go look at your website and give you the same feedback (5 likes & 5 dislike).
  3. Start changing the things you dislike about your website and begin to create a site that has visual impact.

Original article on nature.com by Michael Hopkin Carleton University

-Zach Bauer | 5j Design