Partial Pixel Values

Facebooktwittergoogle_pluslinkedin

Today’s Question: In a recent eNewsletter you stated that in camera “With most cameras each individual ‘pixel’ on the image sensor is only recording a single color value (generally red, green, or blue)”. Can you expand on this and explain how we end up with all three color values for each pixel from such slim camera data?

Tim’s Quick Answer: There are certainly exceptions, but with most digital cameras the image sensor uses a sensor where each “pixel” is only recording a single color of light. Essentially each photosite on the sensor has a colored filter in front of it, so each photosite records only red, green, or blue light. Either in the camera (in the case of JPEG capture) or in post-processing (with RAW capture) the “other” values are calculated based on surrounding pixel values.

More Detail: It might seem a little outrageous that two-thirds of the information in a digital photograph is created after the capture, but it is true for the vast majority of digital camera sensors. And I can make the situation sound even worse.

The red, green, and blue photosites on the image sensor aren’t distributed in equal quantities in most cases. On a typical sensor half of the photosites are capturing green light, one-quarter are capturing red light, and one-quarter are capturing blue light. This is because the green light represents the most prominent light in the scene based on nature of human vision. One way to think of this is to consider that in an RGB image, the green channel will most often represent the best black and white image if you could only choose among the three channels to create a black and white image.

So, how is that “extra” information created out of thin air? To be sure, the process is complicated and there are many advanced algorithms at work behind the scenes when processing a RAW capture. But in basic concept it isn’t actually too complicated.

Instead of thinking about the final color photograph, think about the individual channels that comprise that color image. Each of the channels (red, green, and blue) are black and white images that reflect how much red, green, or blue light should be combined to create the color value for each pixel. You can get a sense of this by viewing the individual color channels for a color image using the Channels panel in Photoshop.

Imagine a black and white photo, consisting of many shades of gray. Now imagine that every other pixel is blank. That is what the unprocessed green channel looks like for a RAW capture, in terms of the image sensor only recording green light for half of the pixels on the image sensor. The software simply (I use the term loosely) needs to calculate the missing values in between each green pixel value. In theory you could just fill in the blanks with the average of the two adjoining pixel values, but of course in the real world the math is far more complicated.

Keep in mind also that besides having half of the pixel values for the green channel, the software processing a RAW capture also has red and blue values for the surrounding pixels. So there is a reasonable amount of information to provide an ability to infer pixel values.

Of course, for the red and blue channels the situation is a little more challenging, since fully three-quarters of the information is “missing” for those channels. But the same basic process applies (with complicated math in the background) and the “other” color values for each pixel can be calculated.

To be sure, in the early days of digital capture the task of “filling in the blanks” (a process that is generally referred to as demosaicing, by the way) wasn’t performed very well. Over the years the software for RAW processing has gotten much more advanced. This enables the initial color information to be calculated more accurately than was the case with earlier software, and it also means that greater detail and sharpness can be preserved.

I suppose it would be fair to say that in simple concept, the task of demosaicing is relatively straightforward. You “simply” need to fill in the blanks based on what you can infer from surrounding pixel values. But, of course, the math behind this processing is quite complicated. Thank goodness there are very smart software engineers who have tackled this task and provided us with a variety of high-quality RAW-processing software!

Wrong Import Order

Facebooktwittergoogle_pluslinkedin

Today’s Question: Are high-speed bursts typically written to CF and SD cards out of capture order? I sometimes shoot sports action with a Canon 1D X (using 90 MB/s CF) or people in motion with an Olympus E-M1 (80 MB/s SD). When I convert the raw files — captured at 10 fps — to dng and upload them to Lightroom specifying a numerical sequence, they often sequence out of capture order. For example, in a horse-racing burst the lead horse in frame #20 is clearly farther along the track than in frame #21. Or a person crossing the street will appear to have taken two steps backward from frame #5 to frame #6. What’s going on here?

Tim’s Quick Answer: I’ve only seen this behavior a small number of times, and have not been able to determine whether it is an issue with Lightroom or if it is perhaps an issue with how the images were written to (or read from) the media card. However, you can solve the issue by renaming after (rather than during) import with the sort order set to “Capture Time”.

More Detail: It is altogether possible that the camera is writing the images to the card in the incorrect sequence, especially with burst capture. Cameras generally write each new capture to the camera’s buffer first, and then transfer each image from the buffer to the media card. The images are written in the order they are captured, but I’m sure with high-speed capture it is possible the buffer might write images out of order.

I’ve also seen some indications (which I’ve never been able to verify) that Lightroom sometimes imports photos in the wrong order. This seems to be an inconsistent behavior, and it is also possible that the issue actually lies with the card and not Lightroom.

In any event, you can work around this issue by saving the renaming for after the import rather than during the import. Simply import the photos with the renaming option turned off, and then sort the imported images based on Capture Time. You can then select all of the images, make sure you are in the Library module, and choose Library > Rename Photos from the menu to initiate the file renaming using the same settings you would have otherwise used during import.

File Size Mystery

Facebooktwittergoogle_pluslinkedin

Today’s Question: When I take a 40MB DNG file from Lightroom to Photoshop, the resulting TIFF file is 207MB. Why does the file size increase by a factor of five and is there some way to reduce the TIFF file size?

Tim’s Quick Answer: There are three basic factors at play here. First, if the Adobe DNG file was created from a proprietary RAW capture format (or was a DNG capture out of the camera), the image data within the DNG file only contains one-third of the total information in terms of pixel values (more on this in a moment). Second, the DNG format uses compression that typically results in a file size that is around 20% smaller than the original RAW capture. Third, the image sent to Photoshop was likely created as a 16-bit per channel image, which doubles the base file size.

More Detail: As you may already be aware, a RAW capture only includes one-third of the total pixel information for the image. There are exceptions and variations here, but with most cameras each individual “pixel” on the image sensor is only recording a single color value (generally red, green, or blue). Part of the process of converting the original RAW capture to a “real” image involves calculating the full color value for each pixel. The result is that the RAW capture is generally about one-third of the file size of the final image, all other things being equal.

The DNG format makes use of lossless compression that results in files that are generally smaller than the original RAW capture, assuming the DNG file was created from a proprietary RAW capture. On average I find that this compression results in a DNG file that is about 20% smaller than the original RAW capture, but your results may vary.

The original RAW capture would contain information based on either 12-bit, 14-bit, or 16-bit per channel information, depending on the specific camera. Once you convert the original capture to a pixel-based format, you have the option of rendering the image in either the 8-bit or 16-bit per channel mode. The 16-bit per channel mode image will be twice as large as the 8-bit version, all other things being equal.

Finally, there is the potential for applying compression to the TIFF image, which results in a smaller file size. For example, you can make use of LZW or ZIP compression for TIFF images created by Lightroom as part of the process of sending a photo to Photoshop. Both of these options provide lossless compression that reduces the size of the image file without any reduction in image quality.

In this case, based on the information you’ve provided, I would guess that the TIFF image is being created in the 16-bit per channel mode, with LZW (or ZIP) compression enabled. In that case, the only real option for reducing the file size (other than reducing the pixel dimensions) would be to create the TIFF file as an 8-bit per channel image rather than a 16-bit per channel image. However, this would also result in less overall information in the photo, and a higher risk of some degree of posterization in the image.

On the assumption that you want to retain the full pixel dimensions of the image, and that you want to keep the image in the 16-bit per channel mode, the only other option for reducing the file size is to be sure to make use of LZW (or ZIP) compression for the TIFF file. These options can be found in the External Editing section of the Preferences dialog in Lightroom.

Subfolder Search

Facebooktwittergoogle_pluslinkedin

Today’s Question: I’m still using Adobe Bridge to manage my photos, as it works well for me. One issue I have run into, however, relates to searching for photos in subfolders. If I have been to the same place several times I make a folder for the place, and then a subfolder for each trip within that folder. Is there any way to search for images matching specific criteria (such as keywords) within all of the subfolders at once, rather than searching in each subfolder one at a time?

Tim’s Quick Answer: Yes, you can filter images across all of the subfolders below the currently selected folder (or even across an entire hard drive). Start by selecting the parent folder containing the subfolders you want to search. Then go to the menu bar and choose View > Show Items from Subfolders. This will cause the images from subfolders to be shown along with those from the current folder, and you can then set filter criteria on the Filter panel to filter among the full set of photos that are now displayed.

More Detail: It is important to keep in mind that because Adobe Bridge is a browser that does not make use of a central catalog for managing photos, the process of browsing and filtering images across multiple folders (or across an entire hard drive) can be a bit slow.

This performance issue is one of the key reasons I favor Lightroom over Adobe Bridge for managing my photos. Because Lightroom makes use of a central catalog, you are able to filter images across many folders much more quickly.

That said, you can indeed browse across multiple subfolders and set filters based on those multiple folders by making use of the “Show Items from Subfolders” option on the View menu.

Incorrect Sort Order

Facebooktwittergoogle_pluslinkedin

Today’s Question: I just returned from South Africa and spent time at two safari lodges. I typically create a separate folder for each lodge that I visit. On my camera (Nikon D600) the images are in the order that they were taken. But when I download them into Lightroom, they are no longer in that order, making it impossible to figure out at which lodge the images were taken. Any suggestions?

Tim’s Quick Answer: The quick solution is to change the sort order to the “Capture Time” option. You can do so by choosing “Capture Time” from the Sort popup on the toolbar below the Grid view display in the Library module, or by choosing View > Sort > Capture Time from the menu.

More Detail: I suspect in this case the sort order has changed to “Added Time” for example, which sorts the images based on the order in which they were added to the Lightroom catalog. This is sometimes not even close to the actual capture order, depending on how the images were written to the card and how they are read by Lightroom upon import.

However, you might have also selected a different sort order based on different criteria. When you choose the Capture Time sort order, the images will be sorted based on the actual capture time embedded in metadata for each image. This is generally my preferred order for sorting my photos, though obviously there are situations where other options are preferred.

I try to make a point to change the sort order back to Capture Time as soon as I’m done reviewing photos using any other sort order, as otherwise I have a tendency to get confused about why the photos aren’t appearing in the order I’m expecting them, or why the photos seem to be in a random order.

Note, by the way, that you can also filter the images by date, which might be helpful for a situation where you want to view images based on the date (or dates) they were captured. To filter by date, make sure the Library Filter bar is displayed (you can choose View > Show Filter Bar from the menu if it isn’t visible). Then set one of the columns for the filter bar to Date, and select the desired date (or dates) from that column, making sure that any other columns are set to “All” (unless you want to apply an additional filter to the images).

Magic Wand Vs. Quick Selection

Facebooktwittergoogle_pluslinkedin

Today’s Question: You addressed a question [in yesterday’s Ask Tim Grey eNewsletter] about the Sample Size setting for the Magic Wand tool. My question is, with the Quick Selection tool now included in Photoshop, isn’t the Magic Wand tool obsolete?

Tim’s Quick Answer: I don’t consider the Magic Wand tool in Photoshop to be obsolete, though I do use the Quick Selection tool more often than the Magic Wand tool. However, when I need to create a selection that consists of a relatively large number of non-contiguous areas, the Magic Wand tool often provides the best solution.

More Detail: To create a selection consisting of a variety of non-contiguous areas using the Quick Selection tool in Photoshop, you would need to paint individually on each of the non-contiguous areas. This can obviously be a very inefficient approach when the selection you need to create consists of a relatively large number of non-contiguous areas.

If you are creating a selection of one large area in an image, or of an area that is comprised of a small number of non-contiguous areas, the Quick Selection tool can most certainly be perfect for the job. But when numerous non-contiguous areas need to be included in the same selection, the Magic Wand tool is generally a better solution.

With the Magic Wand tool selected, I will generally set the Tolerance value to a relatively low number (generally somewhere between 8 and 16, depending on the image), and I will set the Sample Size to “3 by 3 Average” (as noted in yesterday’s edition of the Ask Tim Grey eNewsletter). I will also turn off the Contiguous checkbox, and then create the selection.

For example, if I am creating a selection of the sky (which is a common scenario for using the Magic Wand tool) I will initially click on an open area of sky. I will then hold the Shift key and click on additional areas to sample other pixel values, expanding the range of the selection. Because the Contiguous checkbox is turned off, that selection will include non-contiguous areas of the sky. Therefore, it does not require very many clicks of the mouse (holding the Shift key for the “Add to Selection” option) to create a complete selection.

The key thing to be careful of when the Contiguous checkbox is turned off for the Magic Wand tool is that the selection might include unwanted areas. For example, if there is a lake in the foreground that reflects the sky, that area may be selected even though you don’t want it selected. These issues can generally be resolve rather easily, however, using the Lasso tool, for example, with the “Subtract from Selection” option enabled to remove unwanted areas from the selection.

So yes, I most certainly make use of the Magic Wand tool on a regular basis in Photoshop. I don’t use the Magic Wand nearly as often as I use the Quick Selection tool, but the Magic Wand tool still proves invaluable in certain situations.

Sample Size for Selections

Facebooktwittergoogle_pluslinkedin

Today’s Question: I was watching one of your (great!) videos recently, where you covered the creation of selections using the Magic Wand tool in Photoshop. In this lesson you suggested increasing the Sample Size for the Magic Wand tool to “3 by 3 Average” using the popup on the Options bar. However, I am using a slightly older version of Photoshop, which does not include this setting. Is it possible to create the same effect some other way?

Tim’s Quick Answer: The “Sample Size” popup on the Options bar when you select the Magic Wand tool in Photoshop is actually a “shortcut” of sorts to the same setting for the Eyedropper tool. So the “trick”, in this case, is to first select the Eyedropper tool, then set the Sample Size setting on the Options bar, and then return to the Magic Wand tool. The setting you established for the Eyedropper tool will apply to the Magic Wand tool.

More Detail: In many respects the Magic Wand tool is essentially an extension of the Eyedropper tool. The Eyedropper tool is used to sample a specific color value in a photo, and the Magic Wand tool also samples a color from a photo. The difference is simply that the Magic Wand tool creates a selection based on the sampled pixel value along with the other settings for the Magic Wand tool.

In older versions of Photoshop it was not as obvious that it was even possible to adjust the Sample Size setting for the Magic Wand tool, or that the Magic Wand tool was even related in some ways to the Eyedropper tool. Fortunately, relatively recently there was an update that added a Sample Size popup to the Options bar for the Magic Wand tool.

The important thing to keep in mind is that the Sample Size popup for both the Eyedropper tool and the Magic Wand tool is actually a single setting in Photoshop. In other words, if you change the Sample Size setting for the Magic Wand tool, that same setting will be reflected for the Eyedropper tool. And, conversely, if you change the setting for the Eyedropper tool the same setting will be reflected for the Magic Wand tool.

Fortunately for those using an older version of Photoshop, the bottom line is that the same option is still available, so you can adjust the Sample Size setting for the Magic Wand tool using the settings for the Eyedropper tool.

Thumbnail Size

Facebooktwittergoogle_pluslinkedin

Today’s Question: Is there no way to resize the thumbnails on the filmstrip in Lightroom? I have found the control for resizing thumbnails when I’m using the grid view, but I don’t see any way to change the thumbnail size for the filmstrip.

Tim’s Quick Answer: You can most certainly resize the thumbnails on the filmstrip in Lightroom. To do so, you simply resize the filmstrip panel itself. As you drag the top edge of the filmstrip panel up and down, the thumbnails on the panel will get larger or smaller, respectively.

More Detail: The left, right, and bottom panels in Lightroom can all be resized, enabling you to adjust how much information is displayed on those panels versus how much space is available for the central preview area for your photos.

For example, if you have a lot of long folder names you might want to enlarge the left panel in the Library module, so you can read the entirety of each folder name. And, as noted above, resizing the bottom panel (the filmstrip) will cause the thumbnails to be resized.

Note, by the way, that the Thumbnails slider that appears on the toolbar below the Grid display can be hidden or revealed. So if you don’t see the Thumbnails slider when using the Grid view, you can enable it by choosing Thumbnail Size from the popup at the far right of the toolbar. And if the toolbar at the bottom of the preview area isn’t visible at all, you can toggle the display of the toolbar by pressing the letter “T” on the keyboard.

File Size Parameters

Facebooktwittergoogle_pluslinkedin

Today’s Question: Is there is a difference in quality of image appearing in Flickr exporting from LR and uploading to Flickr using these two different methods:

1) Set file size specifically to 2.3MB

2) Set long dimension to 1920 pixels

I uploaded the same image using the two methods and Flickr shows the uploaded file size as:

1) Exported from Lightroom as a 2.3 megapixel file, then uploaded to Flickr. The image in the Flickr site has the original file size as 1856 x 1239 and 1.0MB.

2) Exported from Lightroom with longest dimension at 1920 pixels, then uploaded to Flickr.   The Flickr site has the original file size as 1920 x 1281 and  1.06MB.

Tim’s Quick Answer: There is no difference in terms of the image quality with either approach, assuming that you use settings that result in the same pixel dimensions with the same JPEG Quality setting.

More Detail: The Image Sizing section of the Export dialog in Lightroom provides a variety of ways you can describe the pixel dimensions you’re looking for. All of them essentially vary only in how you describe the final size of the image, not what the final size will be.

For simplicity, let’s assume an example where we’re exporting a square image, and that we want to create a file at a specific size. For our purposes we’ll assume we are exporting the photo to be printed at 10-by-10 inches at 300 pixels per inch.

In this case you can specify, for example, that you want the exported image to be sized at 10-inches by 10-inches at 300 pixels per inch (using the Width & Height option). You could also specify that you want the image to be 3,000 pixels on the long side (using the Long Edge option). You could use the Dimensions option and specify 3,000 pixels for both width and height, with the resolution set to 300 pixels per inch. And you could use the Megapixels option and specify 9 megapixels at 300 pixels per inch.

All of the above options are simply a different way to instruct Lightroom that you want the image sized to 3,000 pixels by 3,000 pixels. The various options are mostly provided simply because different people think of output sizes in different ways. They also provide flexibility in terms of being able to specify all images will be sized to the same size on the long edge regardless of whether the image is a horizontal or a vertical, for example.

The only “catch” with specifying the output size in megapixels is that you aren’t able to specify the pixel dimensions with as much precision, so to speak. This is illustrated by the example provided in today’s question.

If you multiple the pixel dimensions together for the example created with a 2.3 megapixel setting (1856×1239) you find that there are 2,299,584 pixels, which equates to 2.3 megapixels. The image sized based on the Long Edge option has pixel dimensions of 1920×1281, which translates to 2,459,520 pixels, or almost 2.5 megapixels.

So, if you had used the same pixel dimensions for the Long Edge option (1856 pixels) you would have ended up with two images of the exact same pixel dimensions, at the exact same image quality, and with the exact same file size.

Again, the resizing is performed based on the actual pixel dimensions, and there are various ways to describe those dimensions when exporting a photo. But with equal settings, all of the various options will produce the same result in terms of image quality.

RAW File Sizes

Facebooktwittergoogle_pluslinkedin

Today’s Question: I recently bought a Fuji X-T1 camera. It has a 16 megapixel sensor. The file size in RAW (RAF) is approximately 33.3 MB. My Nikon D4 which also has a 16 megapixel sensor has a RAW file (NEF) of about 20 MB. When I convert the RAF file to a DNG, the file size goes down to about 21 MB (from 33MB). What’s going on here?

Tim’s Quick Answer: The size of a RAW capture certainly has a relation to the resolution of the image sensor, but it is also affected by the bit depth of the analog-to-digital conversion for the camera, compression applied to the RAW capture data, and other factors. In short, the sizes here are not unusual considering the amount of information being gathered.

More Detail: An image that contains around 16 megapixels of information (as is the case with the two cameras referenced in today’s question) will result in a file size (without compression) of about 92 megabytes if the image is saved in the 16-bit per channel mode. If the image is instead saved in the 8-bit per channel mode, that value will be cut in half to about 46 megabytes.

In other words, any file size for the RAW capture file that is less than the 16-bit uncompressed value for the image based on pixel dimensions is not too surprising. The bit depth of the analog-to-digital conversion plays a role, compression (even if lossless) plays a role, and “special” proprietary data saved by the camera will also affect the RAW file size.

In the specific example cited here, the information related to the NEF file size suggests that the captures are being processed at a lower bit depth, are being captured at a lower resolution, or have compression applied (all of these options are available for the Nikon D4). Based on the specifics here, I suspect you have compression enabled for the RAW captures on the Nikon D4. If you capture at full resolution and the full 14-bit per channel depth without compression, you can expect file sizes for the NEF capture that are about the same as those with the Fuji camera of the same resolution.

Converting a RAW capture to a DNG file will generally produce a file that is around 20% smaller than the original RAW capture, and so your experience with the RAF files does not stand out as being unusual. When you convert to DNG lossless compression is applied, which will reduce the file size compared to the original capture. The specific degree to which file sizes are reduced varies based on the original capture data.

So, you’re capturing the same amount of information, more or less, but producing files of a different size based on how that information is actually recorded. In general this relates to overall resolution, bit-depth, and compression, though in this case I suspect compression is the only real factor involved.