workshop assignment 1 – image size and quality
This sessions assignment introduces us to JPEG image size and quality and it's impact on digital developing and post-processing (printing or editing). We also look into camera RAW.
Digital cameras frequently record images in the JPEG format. JPEG stands for Joint Photographic Experts Group, formed in 1982.
JPEG uses a lossy compression method for photographic images. The degree of compression, or quality, can be adjusted, allowing a selectable tradeoff between storage size and image quality.
JPEG is based on human perception and typically achieves a 10:1 compression ratio with little perceptible loss in image quality. It's compression algorithm is at its best on photographs and paintings of realistic scenes with smooth variations of tone and color.
It is not well suited for line drawings and other textual or iconic graphics, where the sharp contrasts between adjacent pixels cause noticeable artifacts or image degradation.
JPEG offers us only one real advantage - image file size. With JPEG compression, the 22Mb RAW image file from a 14.6 mega-pixel camera can be saved in a JPEG image file as small as 3Mb. All digital cameras allow us to set the size of the image file created. These options are located under the cameras MENU or FUNCTION buttons; consult your cameras manual in the index under image size. Look for options like
- the letters L, M or S, sometimes shown with the pixel dimensions (ie 1920×2400, 1280×1024 or 1024×768). there may also be settings like M1, M2, ... .
- the size of the image file expressed in mega-bytes, such as 10M, 8M, 4M, etc.
These settings determine how much of the actual data captured by the image sensor is used to generate the JPEG image file. For example, on a 12 mega-pixel camera, the numbers may be 12M, 10M, 8M, 6M or the like. Setting the image size to 6M will result in ½ of the image sensor data being discarded.
Whether this a bad thing or not depends on what you intend on using the image for. For example, a 14.6 mega-pixel image is large enough to print a 13"×19" image with no noticeable loss of image quality. If you are taking pictures to send to friends in email, or put up on a website, a 2M image size gives an image over 1280×1024 pixels. Even this is often too large for email, but for high quality 8"×10" prints, image sizes of around 1920×2400 pixels or 4-6M should be used.
If you are unsure how the image might be used, use the largest image file possible; it can always be "downsized" in post-processing. Remember that in post-processing we can throw pixels away to get smaller images; "upsizing" to get large images will introduce undesirable pixelation or artifacts. The only caveat here is that larger image files will file up your memory card faster - it's another compromise you should be aware of.
As well as supporting various image file sizes, you can also specify the JPEG compression quality. The higher the quality, the less information that is lost in compression. But the higher the quality, the larger the JPEG image file. Usually these options are found right next to the image size settings and can be shown as
- the words "Superfine", "Fine" or "Medium", or
- 1 star, 2 stars, 3 stars, ..., or
- a set of icons as shown below
This sets the degree of compression, or quality, allowing a selectable tradeoff between storage size and image quality. Here again, unless you find yourself running out of room of your camera's memory card, I strongly recommend selecting the highest quality available. You can't reconstruct image data from non-existent information. You can however, reduce the quality in post-processing to suit your needs at that time.
It is instructive to see just how much a image file size is reduced when compressed at higher or lower image quality settings, and that is part of this assignment.
For our purposes in this workshop there is one significant disadvantage that we need to fully understand. JPEG is a lossy format. This means that up to ten pixels of data captured by the camera are collapsed into one pixel - this give us the 10:1 compression ratio. While this may not affect perceived image quality at first, each time a JPEG image is opened in an image editing program, modified and re-saved, this compression compounds on itself. This can result in significant loss if image fidelity and increased image contrast and saturation as shown below on the right.
Camera RAW is found on all modern higher-end digital cameras, usually Digital SLRs.
There are some significant benefits to shooting in camera RAW.
- camera RAW is not compressed; all the data from the image sensor is captured and written into the image file. This ends up with very large image files sizes, typically on the order of 10Mb or larger,
- special software is needed to process RAW images. Google Picasa supports most of the modern RAW formats, as does Adobe's Photoshop Lightroom,
- because all the image sensor data is captured, there is significantly more latitude in post-processing, or digital developing. Images that have been over or under exposed can usually be brought back into range with no loss of image quality.
However, unlike JPEG, there is no one standard. Each camera manufacturer has their own usually unpublished and often proprietary RAW file format. Canon uses the file extension .CRW or .CR2, Nikon uses .NEF and Pentax uses .PEF. For each manufacturer, there is yet another corresponding RAW file format.
Adobe to the rescue! In 2004 Adobe announced an open standard, extensible camera RAW file format known as DNG, short for Digital NeGative and using the file extension .DNG. This is a publicly available archival format for the raw files generated by digital cameras. Many of today's more recent digital cameras offer DNG as a RAW format (Pentax, Hasselblad, Leica, Casio, Ricoh, Samsung and many others).
What do I use?
- camera RAW, DNG format, and
- AdobeRBG colour space
By using a standardised workflow (the order and the manner in which I capture and process my images), these options offer me the most flexibility.
What should you use?
Again, it very much depends on your needs. If you can afford the memory cards and intend on creating magic with your images through digital developing, I strongly recommend camera RAW and for the best in camera RAW and to maximize inter-operability, use DNG if your camera supports it.
I hope that by introducing the basic concepts of
- dynamic range,
- colour space,
- image size,
- image quality, and
- camera RAW
you have a working understanding of the limitations of technology and what the various options that are available offer you in terms of the most flexibility needed to meet your photographic needs.
Take a series of photographs using all possible combinations of JPEG image size and image quality. If your camera offers three image sizes (L, M, and S) and three image quality settings (Superfine, Fine, Medium or 1 star, 2 star, 3 star) you should end up with 9 images. If you have three images sizes and four quality settings, you should end up with twelve images. For example,
- Large - 4 star, 3 star, 2 star and 1 star, and
- Medium - 4 star, 3 star, 2 star and 1 star, and
- Small - 4 star, 3 star, 2 star and 1 star
Rename each file to indicate the image size and image quality setting used (ie "large-4star.jpg", ...).
And finally, if your camera offers it, take one photograph in camera RAW format.
Notice the wide range of file sizes produced and the number that your memory card can hold before it fills up. If you take photographs in high-contrast settings, you should see small artifacts in the lower quality (1 star) JPEG images around high-contrast edges (i.e. where a very dark outline butts up against a very bright surface). This is where the JPEG compression algorithm lets us down.
None of this should be visible in higher quality JPEG images or in camera RAW images.
That's all for session 1 - session 2 is on Wednesday, January 27, 2010.