JPEG File Size Variations

Facebooktwitterlinkedin

Today’s Question: In a recent answer you said about JPEG file sizes: “with variation based on the actual contents of the image”. What do you mean by that? Wouldn’t the file size be based only on the pixel dimensions and the quality setting used.

Tim’s Quick Answer: The file size of a JPEG image is primarily determined by the pixel dimensions and the quality setting. However, the specific file size result will vary based on the complexity of information in the image file. In other words, the more variation there is in pixel values, the larger the file size is likely to be.

More Detail: JPEG compression operates by dividing the image up into blocks of pixels and simplifying the information within each block. For example, an image would typically be divided into blocks of 256 pixels (16×16 pixels in a block). Within each block, the pixel values are simplified.

For example, let’s assume that in a given block all 256 pixels are pure white. With no compression at all, you essentially would need to say “white” 256 times to describe the contents of the block. But it would be much more efficient to simply say “256 white pixels”.

In a similar way, JPEG compression will alter the pixel values within each block in order to be able to describe the pixel values more efficiently, resulting in a smaller file size.

For my example of 256 white pixels, the information can be described with great efficiency, so that block would represent a smaller file size. If, on the other hand, there was tremendous variation within a block of pixels, it isn’t as easy to simplify the contents of that block without further degrading image quality. That would result in a larger file size.

So, with an image at a particular size in terms of pixel dimensions, and with a specific quality setting for the JPEG compression, the file size can still vary considerably for different photos based on the actual contents of the image.

JPEG Export Settings

Facebooktwitterlinkedin

Today’s Question: When exporting a raw, TIFF, or PSD file as a JPEG from Lightroom, you may need to reduce the output JPEG file size for sending via e-mail for example. You can reduce the JPEG quality, or you can specify a maximum file size, or you can resize the image and specify the resolution. For the equivalent JPEG file size, which of these approaches give the best quality JPEG image?

Tim’s Quick Answer: When creating a JPEG image, the pixel dimensions primarily determine the potential output size, and the Quality setting determines the amount of quality degradation caused by compression. Both are important, but I would make it a priority to use a relatively high Quality setting (about 80% or above).

More Detail: The pixel dimensions determine how many pixels are included in the JPEG image you’re exporting. That, in turn, determines how large the image can be displayed or printed. When printing the image can certainly be enlarged to a degree, but an extreme enlargement can result in poor print quality.

The Quality setting relates to compression applied to the image in order to reduce file size. Even at a relatively high Quality setting, the file size will be relatively small. But if you use a setting for Quality that is too low, compression artifacts may be visible in the image.

I recommend taking a balanced approach. For printing you’ll need to determine the pixel dimensions required for the intended output. For digital displays, you can set pixel dimensions that will provide an adequate display size based on how the image will be displayed. For a typical monitor display, for example, I’ll generally resize the image to about 2,000 pixels on the long side. I’ll then typically use a Quality setting of 80%. This provides an image of very good quality for a digital display, with a file size that is generally around 1MB or so (with variation based on the actual contents of the image).

Note, by the way, that the pixel per inch setting is not critical and does not impact file size. This is simply a setting that determines the print resolution. It does not affect the image appearance on a digital display.

Native versus Base ISO

Facebooktwitterlinkedin

Today’s Question: Is “native” ISO synonymous with “base” ISO? Is there only 1 “native” ISO?

Tim’s Quick Answer: No, native and base ISO are not necessarily the same thing. A native ISO is an actual amplification setting in the camera that does not require interpolation in processing. The base ISO is the lowest of the native ISO options.

More Detail: Digital cameras offer a wide variety of ISO settings. However, in many cases the options available are not truly “native” options. What that means is that the camera essentially doesn’t have all of the ISO settings you can choose from as built-in amplification options. Instead, the capture data needs to be interpolated to calculate pixel values for non-native ISO settings.

For example, you may be able to select an ISO setting of 160 on your camera. But chances are, the only native ISO settings in that range are 100 and 200. To calculate the pixel data for 160 ISO, the camera could expose based on 200 ISO and then interpolate the data to achieve a final exposure based on a 160 ISO setting.

In many cases a camera will offer native ISO settings in one-stop increments, such as 100, 200, 400, and so on. Values in between are generally non-native, being calculated based on interpolation.

The point is that a camera will generally offer multiple native ISO settings. The base ISO setting is simply (in most cases) the lowest of those native ISO options.

Stylus and Tablet

Facebooktwitterlinkedin

Today’s Question: Which stylus and tablet do you recommend for working in Photoshop CC?

Tim’s Quick Answer: Personally I recommend the Wacom Intuos Pro in the medium size (https://amzn.to/2MmOmw8) as an excellent tablet. Another option worth considering is the Wacom Cintiq (https://amzn.to/2Mr6ogD), which is a monitor display with integrated stylus support.

More Detail: There are a variety of different tablet and stylus options available, but I have long considered Wacom to offer the best. The Intuos Pro line of tablets are standalone tablets that enable you to use a stylus to “write” directly on the tablet. This is somewhat similar to using a mouse on a mousepad, but with the additional benefit of working with a “pen” rather than a mouse.

There are several sizes of tablet available, but I find the medium size works best for me. The small size tends to feel a little cramped, and with the large size I find it often feels a bit too sprawling. That said, different photographers will prefer a different size, so I recommend testing out the various options before making a purchase decision.

In addition to the tablets, there are monitor displays that have integrated stylus support. These are somewhat similar to the use of a touch-enabled display, such as you may be familiar with on a smartphone or a variety of laptops and other devices. The difference is that with the Wacom Cintiq display, you can use a stylus with a variety of customization options to draw directly on the display.

It can certainly take a little bit of time to get accustomed to using a stylus. That said, I feel the time is worthwhile, as using a pen to write on a tablet (or display) provides you with much greater control and accuracy. This is especially helpful when you need to paint or draw with precision, such as when creating selections or painting on a layer mask for targeted adjustments or when creating composite images.

Compression Clarification

Facebooktwitterlinkedin

Today’s Question: Am I correct that image degradation to a JPEG only occurs if some sort of file manipulation takes place and it is re-saved? But if a file is just opened to see the contents and then re-saved (closed) without any change then the image is not subject to further lossy changes? And what about JPEG 2000?

Tim’s Quick Answer: Yes, you are correct about JPEG compression. A JPEG image always represents some degree of quality loss compared to a non-compressed image. However, additional degradation of image quality will only occur if the image is changed and then saved. Re-saving the same image with no changes will not result in additional quality loss. And JPEG 2000, by the way, provides improvements over JPEG (including an option for lossless compression), but has not been widely adopted.

More Detail: JPEG compression is always “lossy”, meaning some degree of quality will be lost when a photo is saved in the JPEG format. The Quality setting for the JPEG image determines the degree of compression applied to the image, and thus the degree to which quality is lost.

If you make changes to an image and then save it again as a JPEG image, there will be an additional loss of quality. However, that loss in quality only applies if the pixel values were changed. So, if you open a JPEG image, don’t make any changes, but re-save the same image multiple times, there will be no additional loss of quality for the image.

But again, making changes to the image and then saving again as a JPEG will cause an increased degradation in quality for the image compared to the “original” version of the JPEG, because the compression would then be applied again to the image.

The JPEG 2000 file format provides advantages in terms of compression and image quality compared to the JPEG file format. However, JPEG 2000 has not been widely adopted and therefore is not supported in all software applications. It is supported by Photoshop, for example, but not Lightroom.

Batch Conversion

Facebooktwitterlinkedin

Today’s Question: I want to take a large number of TIFF files and convert all of them to 72 ppi [pixels per inch resolution] and into JPEG files. Is there a way to do this in Lightroom, and if so, how?

Tim’s Quick Answer: You can convert photos from one file format to another using the Export feature in Lightroom. If you want to include the converted images in your Lightroom catalog, you can turn on the “Add to This Catalog” checkbox in the Export dialog.

More Detail: Lightroom doesn’t provide an option to directly convert photos from one file format to another, other than the option to convert to the Adobe DNG file format. However, you can convert files to a different format using the Export feature. This includes the ability to add the exported images back to your Lightroom catalog if you want both versions included in the catalog, or if you then want to delete the originals.

Generally speaking I would keep all of the original file formats for my photos in the Lightroom catalog. When I export copies of my photos, those are generally “extra” copies of the images being used for some other purpose, such as to send images to a client.

That said, the Export feature can be very helpful for converting photos from one file format to another for a variety of different purposes. To get started, select the images you want to convert. Then click the Export button at the bottom of the left panel in the Library module. In the Export dialog you can specify where you want the new files to be created, what file format to use, the resolution to be used, along with a verity of other options available.

If you simply want to create copies of your original photos for some other purpose, you can simply configure the desired settings in the Export dialog and then click the Export button at the bottom-right of that dialog.

If, however, you want the new copies of your photos to also be included in your Lightroom catalog, you can turn on the “Add to This Catalog” checkbox in the Export Location section of the Export dialog. This will cause the new versions of your photos to be included in your Lightroom catalog, along with the original source photos. Of course, if you want both versions of your photos included in your catalog, you might also want to export the new versions of the photos to the same folder as the source images you’ve selected for export.

Why JPEG is “Lossy”

Facebooktwitterlinkedin

Today’s Question: I recently received some files from a local museum that looked to be very small at less than 1 MB in size. When I opened them they had more data than I expected. They were saved originally with a Quality setting of “8”. What data quality is lost when images are saved at a lower JPEG quality setting? When the file is reopened do we get the lost detail back?

Tim’s Quick Answer: When you save an image as a JPEG file, the Quality setting determines how much compression is applied. The number of pixels does not change, but the actual pixel values do. Thus, quality is lost, and that quality can’t be improved for that version of the image file.

More Detail: Compression for JPEG images operates by essentially “simplifying” the pixel values in the image. This is typically done by dividing the image into blocks of pixels in a 16×16 grid. That means there are 256 pixels within each block. The JPEG compression will actually alter the pixel values within each block of pixels. The pixel values are “simplified” so those pixel values can be described more efficiently. This is how a smaller file size is achieved.

When a lower Quality setting is used, there is more simplification of the data applied for each block in the pixel grid. In other words, the file size is compressed more, but the quality is reduced in the process.

When you save a JPEG image, the compression is applied to the actual pixel data. That data can’t be magically reconstructed when the image is opened again. In other words, compression will permanently reduce the quality of a JPEG image. This is why JPEG compression is referred to as “lossy” compression. Quality is lost to at least some extent whenever you save an image as a JPEG file.

Flattening Workaround

Facebooktwitterlinkedin

Today’s Question: I totally agree with you that I never want to use the flatten function in Photoshop. Sometimes, though, I want to select exactly what I see on the screen for an area, but going to the top layer, even with “Current and Below” it doesn’t grab what I’m seeing. I have to flatten the image, make my selection, copy the pixels, and then undo the flattening. This works but it’s both inconvenient and a little risky that I’ll somehow do something wrong and lose the layers.

Tim’s Quick Answer: This is a good example of a situation where you would want to use a new “Merge Visible” layer. This is a layer that represents the composite contents of all layers below, which you can then add a layer mask to if you only want the effect to impact a portion of the photo.

More Detail: This question was a follow-up to an answer earlier this week about flattening images in Photoshop. As I mentioned in my original answer, I prefer to never flatten a master image. Instead, I keep all layers intact to maximize the flexibility of my workflow.

In some cases you may find that you can’t really work with certain features (such as filters) when you have multiple image layers. In that type of scenario you can instead use the “Merge Visible” command to create a layer that represents the net result of all layers below.

To get started, click on the thumbnail for the top-most layer on the Layers panel to make that layer active. Then click the “Create New Layer” button (the blank sheet of paper icon) at the bottom of the Layer panel to create a new empty layer at the top of the layer stack.

Next, go to the Layer menu on the menu bar. Press and hold the Alt key on Windows or the Option key on Macintosh, while selecting “Merge Visible” from the Layer menu. This will cause the composite contents of all visible layers below to be created on this new layer (rather than flattening all visible layers).

Note that because the “Merge Visible” command applies only to visible layers, you can prevent certain layers from being included by simply turning off the visibility for those layers.

You can then apply any effects you’d like to the new composite layer. If needed, you can also add a layer mask so this layer is only visible in certain areas of the image. Note that because this layer will block all layers below, if you need to make changes to any work you performed before creating the “Merge Visible” layer, you’ll need to turn off the visibility for the “Merge Visible” layer to be able to see the effect. You might also need to create a new version of the “Merge Visible” layer so that it will reflect any changes you’ve made to layers below.

Import Backup Limitations

Facebooktwitterlinkedin

Today’s Question: Does the GoodSync backup work better than making a second copy upon import [into Lightroom]?

Tim’s Quick Answer: The advantage of using backup software like GoodSync (http://timgrey.me/greybackup) is that the backup will be an exact copy of your source photos, including folder structure. The option to create a backup copy while importing photos into Lightroom will not provide a folder structure that matches your source photos.

More Detail: I am certainly grateful that there is an option to create a second copy of the photos you are downloading as part of the process of importing new photos into your Lightroom catalog. However, I do wish that this backup reflected the same folder structure as the source photos. Instead of making a second copy of the photos into a folder with the same name being used for the original photos, a folder will be created with the name “Imported On” (with the date of import appended to that text).

The result is that the backup copy created during import isn’t an exact reflection of the source photos. Therefore, while I do make use of the option to create a second copy of the photos being imported during the import process, I treat that as a “temporary” backup.

After the import is complete, at my earliest opportunity I will use GoodSync (http://timgrey.me/greybackup) to synchronize the external hard drive containing my photos with a backup drive. The result is that the backup of my photos drive is an exact copy of the primary drive, including folder structure and filenames.

Once you have configured a backup job using GoodSync, you can simply run that job to have the backup drive updated to once again represent an exact copy of the source drive. To me this is an ideal scenario for a backup, since it greatly streamlines the process of recovering from a hard drive failure.

Note, by the way, that I have produced a video course with lessons that outline the approach I use for GoodSync, which you can find on the GreyLearning website here:

https://www.greylearning.com/courses/goodsync

Flatten or Not?

Facebooktwitterlinkedin

Today’s Question: When I return a photo back from Photoshop to Lightroom, I first flatten the image, then Save and Close. Am I wrong to flatten the image?

Tim’s Quick Answer: In my opinion, with very few exceptions, you should never flatten your original “master” image in Photoshop. Instead, I feel the layers should be preserved so you can always make changes to any of the layers at a later time.

More Detail: There are certainly scenarios where an image needs to be in a “flattened” state, without any layers. For example, if you are sending an image to a client you probably don’t want them to be able to see or modify any of the layers in your source image, so you would send them a flattened version of the image.

However, for the “master” image you are using as the basis of any output you produce for a photo (such as printing or sharing online), I recommend keeping the layers intact. In other words, you should not flatten the master image.

To be sure, an image with layers will have a larger file size than a flattened image. However, by keeping the layers intact you are retaining the ability to open the image in Photoshop once again, and make modifications to any of the layers. For example, you might find that some of your image cleanup work resulted in some visual artifacts that you need to correct. Or you might change your mind about one or more of the adjustments you’ve applied to the image. Keeping the layers intact provides you with that flexibility.

So, while you might flatten a copy of an image (or simply use the Save As command to save a new copy of the image without layers), I always recommend retaining the layers in the “master” version of your image. I’m more than happy to have a larger file size in return for the greater workflow flexibility that layers provide.