Posts Tagged ‘compression’
[...] sometimes you increase the quality setting in Photoshop and the actual quality of the image is reduced…
I had never heard of that before, so I decided to dig a little deeper.
JPEGmini is a new image compression service that can magically reduce the file size of your JPEG photos by up to 5 times without any visible loss in quality. ICVT, the Israeli company behind the service, explains how the technology works in an interview with Megapixel:
Our technology analyzes each specific photo, and determines the maximum amount of compression that can be applied to the photo without creating any visual artifacts. In this way, the system compresses each photo to the maximum extent possible without hurting the perceived quality of the photo.
If you’ve ever tried saving a layered file in Photoshop CS5 that’s more than a 1GB in size, you’ve probably experienced pretty sluggish performance. This is because the program always does image compression on the file that shrinks the file size at the expense of your workflow. If you’re rich in hard drive space but short on time, Adobe has released a plugin called that lets you disable image compression, speeding up the saving of large layered files by 20x!
Google unveiled a new image format today called WebP that it hopes will make the web faster by cutting files sizes of images without affecting quality. According to a blog post they published earlier today, photos and images account for 65% of the bytes transmitted by websites. In their tests done using 1 million randomly selected images from the web, re-encoding images as WebP resulted in an average file size reduction of 39%. Here’s a gallery with image and file size comparisons.
Most of you probably know that JPEG is lossy compression method, meaning compression permanently throws out data and detail. Luckily, a typical compression can save 10 times the space of an uncompressed image without sacrificing much noticeable quality. However, if the image is repeatedly compressed and saved, artifacts introduced during compression become more and more obvious.
Reddit member Grundle decided to see what repeated compression looks like by saving the same image over itself 500 times at high quality (10/12 in Photoshop). He then combined the images into the following video:
I think it’s pretty clear why you should always work with RAW files if you care about the quality and longevity of your work. Every time you save those JPEG photographs, you lose a little piece of awesomeness.
These “American Pixels” are an experiment. Image formats like jpeg (or gif) use compression algorithms to save space, while trying to retain a large fraction of the original information. A computer that creates a jpeg does not know anything about the contents of the image: It does what it is told, in a uniform manner across the image.
My idea was to create a variant that followed in the footsteps of what jpegs do, but to have the final result depend on the original image: in a very direct way the computer algorithm becomes part of the image creation. The idea was to build a hierarchical compression algorithm, where the compression – in effect the pixel size – depends on the information in each uncompressed pixel and its neighbours. So adaptive compression (acomp) is a new image algorithm where the focus is not on making its compression efficient but, rather, on making its result interesting.
[...] What is more, it produces images that have spatial depth: as you zoom in you can see more and more details. acomps are designed for a wall: The viewer has to be able to walk back and forth in front of them.
Basically, the algorithm leaves detail where there needs to be detail, and compresses areas of less detail. By doing this, the resulting image doesn’t look entirely realistic, yet doesn’t look entirely artificial either.
Something you may have noticed when adjusting your camera’s ISO setting is that as you increase ISO, the number of remaining shots you have decreases. This is because the size of each photograph increases with ISO, and thus less of them can be stored in the available space of your memory card.
So why does the file size increase as you increase ISO? The answer has to do with image noise and file compression. First we’ll discuss the noise element.
You probably know already that a higher ISO number leads to more noise in the resulting image. This is because digital cameras achieve the same behavior of “more sensitive film” by amplifying the image signal the camera receives when it captures a photograph. This amplification also amplifies the noise that exists in every image regardless of ISO, and therefore higher ISOs have highly amplified noise.
To demonstrate, I captured the following photograph at both ISO 100 and ISO 3200:
Here’s a side by side comparison of crops from the two images:
The noise should be pretty obvious. The RAW file of the ISO100 version is 10.2MB in size, while the ISO3200 version is 14.7MB. In this case, the higher ISO leads to a 44% larger file.
An interesting property of digital cameras is that there is more noise in darker regions of photographs than brighter regions. The opposite is true for film. This means that the file size difference discussed here will be far less when shooting with more light, such as when you’re photographing outdoors.
As an example, here is another scene that I photographed first at ISO100, and then at ISO3200:
Though there is still a significant amount of noise in the image, the ISO100 photo has a 15.8MB file size, while the ISO3200 photo is 16.7MB. This means that for this outdoors shot, the higher ISO only caused a 5.7% increase in file size. There’s other factors that will cause this percentage to fluctuate, such as the complexity of the scene, but in general the percentage should be less when photographing with more light.
Now that we’ve shown the increased image noise that comes with higher ISO numbers, we’ll discuss why this causes the file size to increase.
Regardless of whether you’re shooting RAW or JPEG, it’s likely your photographs are stored in a compressed format. While some cameras allow you to choose whether and how files are compressed, RAW images (i.e. Canon’s CR2 format) are usually compressed using a lossless algorithm, meaning the exact original data can be reconstructed from the compressed data. On the other hand, JPEG is lossy, so the more you work with JPEG files, the less data you’ll have as the compression throws out more and more data.
Here is a sequence of images from Wikipedia showing lossy compression (with PNGs):
The image on the right is the most compressed, and therefore has the least information. There is no way to recover the original detail from the compressed image to reconstruct the original (on the left), since the information was thrown out in order to save space when compressing the file.
The reason noise increases file sizes is because image compression relies on repetition, or patterns. In images with less noise, there are more areas of consistent patterns (i.e. the clear blue sky) that can be compressed. On the other hand, when noise is introduced, these adjacent areas that could have been grouped together and compressed must be split and stored separately, since the noise introduces randomness that cannot be compressed.
Here are four different 100×100 JPEG squares, saved with the same image quality:
On the left is a square with solid blue, which affords maximum compression and therefore the smallest file size. The second square has two shades of blue, alternating by row, while the third square alternates by column. Due to the way the JPEG format compresses images, the second square can be compressed more efficiently than the third, even though both contain exactly the same number of pixels of each shade. Finally, the last square has artificial noise added in using Photoshop. This noise introduces randomness, which results in the least compression and the largest file size.
Now, for a super simplified example of compression, consider the following “photo” with 3 “pixels”:
Since all three pixels are the same, instead of storing the data for all three, one possible way I could “compress” the photo would be to store the color information once and just remember that the entire range of pixels is that color. (i.e. Pixel 1-3 = Blue)
Now, lets say some “noise” is introduced, which changes the image to the following:
Now I can’t specify a single range and a single color, since the sequence has been interrupted. The best I could do might be to say (Pixel 1 & 3 = Blue, Pixel 2 = Yellow), which obviously takes more information to represent.
This isn’t exactly how image compression works, but hopefully you get the point that randomness interferes with compression.
In this post we showed that increasing ISO causes increased noise, which in turn causes larger file sizes due to inefficient file compression. Many of you more advanced photographers might have known some (or all) of this already, but hopefully it was illuminating for some of you.