Tuesday, November 18, 2008

Cineon Converter for Photoshop

This free plug-in fills a missing link in the Photoshop film production pipeline. It applies Kodak's standard log2lin transfer function to a log Photoshop layer, such as one you might get from opening a Cineon file. This is the same operation found in Nuke, Shake, Fusion, and the After Effects Cineon Converter.

In order to convert a log Photoshop document to a linear one:

1) Convert the document to 32-bit floating point, without altering pixel values.

2) Apply the Cineon Converter to each layer.

The Cineon Converter can be scripted using Photoshop Actions. A sample JavaScript is included showing how to automatically apply an Action to each layer in the file.

Once linearized, your Photoshop document is ready to be saved into a linear floating point file format (can anybody think of one?) and brought into your favorite compositor in the proper color space.



Wednesday, October 1, 2008

ProEXR ships with After Effects CS4

OK people, this is big, real big.

It's been officially announced: the free OpenEXR plug-ins I've been shipping for over a year are now going to be appearing in the next version of After Effects! So no longer will you have to replace Adobe's plug-in with the fnord one, because they will be the same! EXtractoR and IDentifier will also be included. You can read more about it here, here, here, and here.

And since you asked, yes, they will be remaining open source, and yes, I will continue to update them on the fnord web site as necessary.

Not included in After Effects will be the Comp Creator, which you can still download. And of course, the ProEXR Photoshop plug-in is separate.

This is really a big honor, and I want to thank the AE team for making it happen. I have had a love affair with After Effects for many years and it's hard to believe my plug-ins are now a part of it. Pinch me!

Update: See my credit in the AE secret about box (hold down option/alt while doing About After Effects). Whee!

Tuesday, September 30, 2008

exrdisplay for After Effects

When you work with linear floating point images in virtually any program, the standard conversion from the linear color space to your screen is usually some sort of gamma curve, a standard image operation. But a trained eye may notice that in some cases, OpenEXR files appear slightly differently. One example is the thumbnail previews shown by Mac OS X. In this case, the curve used is from ILM's exrdisplay program. In the sample below, standard gamma is on the left and exrdisplay is on the right:

Notice how in the exrdisplay version, the sky is not completely blown out. Overbright pixels have been brought into range and do not clip as harshly as they would with a standard gamma curve. ILM is using a modified gamma function and added an adjustable "knee" to make this happen.

Ordinarily this different curve was only of passing interest to me, but then I was helping out some friends put together a pipeline for an Inferno, and found that it also uses this curve, which made it necessary to replicate the same color operation in After Effects, which made me write this plug-in:

It has all the same controls as the exrdisplay command-line program, in addition to a few extras. For one thing, the dithering that exrdisplay always uses is optional in the plug-in.

But more interestingly, I've included a checkbox to apply the inverse function. This means you can take a regular image such as a JPEG and convert it to linear space using this plug-in, with control over the knee which will push some brighter pixels into overbrights. And then when you use the plug-in on the other end with the same settings, all values will round trip.

Anyway, I needed this for my personal use, so thought I'd share. Enjoy!

Mac | Win

Friday, September 12, 2008

ProEXR 1.3 released

A new version of ProEXR is available, adding a key feature that has been requested by users. Whereas the Photoshop plug-in already had a mechanism for effecting the way alpha channels were handled, we've now bumped the feature out of Easter Egg land and into legitimacy via a shiny new dialog.

The dialog does not appear by default. As before, you access the feature by holding down the option (Mac) or alt (Win) key. But now the settings are made clear as day and you can change the defaults to whatever you like. You can even make the dialog appear every time if you crave more modal UI interaction than you're currently getting.

ProEXR 1.3 also includes a variety of other small fixes. Needless to say, we recommend everyone switch to it (without any upgrade fee, of course). Enjoy!

Tuesday, May 6, 2008

Converting to 32bpc in Photoshop Without Altering Pixels

Many people have a problem with color management. They think that when they open a JPEG in Photoshop, the pixels in the file should be the pixels that are shown on screen, but this is often not the case! If you have an sRGB image being viewed on your Mac monitor, Photoshop will darken the display pixels to show what the file would look like on a true sRGB monitor. Even if you think there's no ICC profile for the image, Photoshop will use the working space designated in Color Settings (usually sRGB). In general, this is probably what you actually want, but some people find it unsettling.

In another attempt to force users to do the right thing, Photoshop insists that all 32 Bits/Channel (floating point) images use a linear profile. When you convert your 8-bit sRGB image to 32-bit, Photoshop will linearize the pixels while simultaneously assigning a linear profile. The net result is that the image looks the same, even though the pixel values have changed. Again, this is usually what you want.

Except what if you don't want the pixels to to change, other than get converted to a higher bit depth? It is possible to do this, but it involves tricking Photoshop a little. I'll explain below.

To start, we'll take the famous Marcie image. This is a 10-bit Cineon file in Log space. Photoshop will open it as a 16-bit file without a profile (which means it uses your RGB working space). Marcie is a useful example for us because many film users still paint on Log images.

If you set the Photoshop Info Palette eyedropper to 32-bit mode and sample the grey LAD patch, you'll see values of 0.435 for that area. Now convert this file to 32-bit mode and sample again. Even though the image does not appear to have changed, the LAD patch is now reading 0.159. As mentioned above, the pixels have been darkened while the profile was linearized.

To convert from 16- to 32-bit mode without the change, revert to the original file and follow these steps:

1) Assign a linear profile (Edit > Assign Profile…) that you've previously created. When you do this, the image will appear much brighter, but using the info palette you can verify that the LAD patch is still 0.435. The Assign Profile function doesn't alter pixel values, only how they are displayed.

2) Now convert to 32-bit mode. The image will appear unchanged, which is to say too bright. But when you sample the LAD patch, you'll see that it has retained its value of 0.435. Photoshop usually converts from whatever profile you're using to a linear profile, but because we told it we already had a linear profile, no change takes place.

3) Your pixels are now in floating point Log space. If you save this image to an OpenEXR file, most file readers will assume linear space and brighten the image as Photoshop is doing. It will be up to you to make sure the Log pixels are treated properly in whatever program you're sending them to.

While Photoshop always defaults to using color management, there is a way to turn it off. By going to View > Proof Setup > Monitor RGB (make sure View > Proof Colors is also on), Photoshop will treat the file like is has the same profile as your monitor, so no transform will take place. In the above example, this would show pixels in Log space. You can also use View > 32-bit Preview Options to view a file with Gain and Gamma in 32-bit mode.

This workflow is currently being used in production by film studios who want to paint in Log, but export an OpenEXR file using ProEXR.
The part of the equation that is really missing is a way to convert from Log to floating point linear in Photoshop so that the EXR can have its proper linear values. Hopefully one day there will be a way to do this.

Update: Now there's a way!

Monday, May 5, 2008

Making a Linear ICC Profile

ICC Profiles usually describe devices, and real devices are never linear. In other words, they generally have a gamma other than 1.0, and usually some sort of custom curve you might measure with a spectrophotometer.

But sometimes you want a linear ICC profile. Perhaps you want to set up a linear color space to use in After Effects 7. Or maybe you rendered a 16-bit file into a linear color space using a 3D program and need to tag it that way. Here I'll show you how to use Photoshop to create a linear color profile.

1) Go to the Color Settings dialog (Edit > Color Settings…)

2) If necessary, click on the "More Options" button.

3) Check the profile you have set for your RGB working space. It defaults to sRGB (in Adobe parlance "sRGB IEC61966-2.1"). Whatever profile you set here is the profile that we will be making a linear version of.

4) With your profile set, go to "Custom RGB…" in the same menu. A dialog will pop up.

5) The Custom RGB dialog will be filled in with settings from the profile you previously selected. In many cases the Gamma field will be an approximation, but it doesn't matter because you want to set it to 1.0, making this profile linear.

6) Make sure you edit the Name field. Call the new profile something like "Linear sRGB".

7) You can leave the rest of the fields as they are. Click OK.

8) Your custom profile is now selected in the menu, but it still lives only in Photoshop. We want to save it out by going to "Save RGB…" in the same menu. This will give you a Save As… dialog. You should drop the profile someplace it will be seen by other applications, such as:

Mac: /Library/Application Support/Adobe/Color/Profiles/
Win: C:\Program Files\Common Files\Adobe\Color\Profiles\

Give the profile a reasonable file name, although the name you used previously in #6 is what will appear in menus. You probably want to name the file the same.

9) With the profile saved, you probably would prefer to Cancel out of this dialog box, assuming you don't want to set a linear profile to your Photoshop working space.

And with that you've created a linear profile to be used in any profile menu. ICC profiles in general consist of a combination of color primaries and response curves. The color primaries describe the device-independent color sensation you get when the display shows pure red, green, blue, or white. The response curves (which could be a simple gamma curve) describes the transition from red/green/blue to black.

In the process described above, we adopt the color primaries from a profile and set the response curves to linear. If we convert an image from the original profile to the linearized profile, the result is a simple Gamma-style transformation that doesn't involve channel cross-talk and can easily be reversed.