Posts Tagged ‘masks’

I thought I’d take a break from my usual ramblings about music and the arts for a quick little sidetrack into technology. So if you’re here to see what I think of the latest Woody Allen film (brilliant and Oscar-worthy!!) or were hoping to find a post about my newest photo (which features an anatomical view inside a giant kewpie)… come back later. Actually, that’s not entirely true; I’ll be using my latest photo as the backdrop for sharing a tip for using Aperture, Apple’s pro-level application I use to manage and adjust my photos.


If you’re not quite up to reading some of the background of how and why I decided to come up with this hack, jump down the page to the step-by-step instructions marked “How to copy Aperture brushes.” If you stick around, though, I promise to make your reading interesting…

I’ve been using Aperture since its very first version when it represented a nice step up from iPhoto. Aperture provided the ability to apply a much wider range of adjustments to your photos: definition, vibrancy, tweaking individual colors, and more. In those early days, adjustments were applied evenly across an entire image, so you had to be very, very careful that adjustments did not collide with one another. A deft hand was required, for example, to marginally adjust the yellow petals of a flower without the unfortunate side effect of making any people in the photo appear as though they had acquired Hepatitis-C.

The latest version of Aperture introduced the concept of brushes, which allow adjustments to be applied to very specific and well constrained areas of a photo without impacting the entire image. Think of Aperture brushes as the digital equivalent of applying an effect through a stencil that’s been placed over your image.

In typical Apple fashion, a “brush” is really just an easier-to-understand name for much more complex computer science principles like layers, alpha channels and… masks. Lots of other applications foist these decidedly unfriendly concepts onto poor unsuspecting users, then go the extra step by building cumbersome user interfaces around these powerful tools. Aperture’s not like that. Instead, you have a brush. Easy.

In my work, brushes have been both a blessing and a curse. Where in the past I had a finite set of tools for improving images en totale, I can now brush away to my heart’s content until EVERY LAST OBJECT ON THE SCEEEN has undergone the touch of my digital spell. It’s great!

Though the Aperture brush feature provides a convenient way to detect the edges of an object as the brush is moved around the screen, this feature is not so sophisticated that it takes on the geographic capabilities of a paint-by-number canvas. Adjustments frequently “paint outside the lines”, and to this end brush strokes can be erased, sized, and adjusted for softness and opacity.

I spend a lot of my postproduction time painstakingly outlining and filling in the dozens of irregularly shaped figures and objects that inhabit each of my photos. To illustrate, let’s take a look at a typical brushed in adjustment from my latest photo, Clinical study at the Mary Shelley School of Theologic Medicine.

Overlay of a brush on a single object

In the image to the right you see a color overlay of the brush I applied to add a little definition to a tiny plastic figure of a circus performer. Brushing around the roller coaster of nooks and crannies that define the figure takes a lot of time, but once complete I’m confident that the adjustment being applied will take effect on the entire object; nothing more. Great! Looks good.

But what if I decide that the exact same object could benefit from another adjustment? Maybe a tweaking of the color tint or a touch of vibrancy? Surely, there must be a way to copy all that complex brushing from one adjustment to another.

Uh… no, there’s not.

Usually I just bite the bullet, set the screen zoom back up to 150%, and draw in the new brush as my fingers cramp and my shoulders scream. While working on the new piece, and faced with several regions of the photo that could benefit from multiple adjustments, I finally reached my “re-brushing threshold” and developed a nice little process for applying the same brushing mask to multiple adjustments, thereby GREATLY reducing the time that would have otherwise been required for postproduction.

Time to share!

Aperture applies each of its brushed adjustments through TIFF files, which (as stated earlier) act just like stencils. Each adjustment you make to a photo will have a corresponding TIFF file hidden away inside your Aperture Library. Change or move the TIFF files, and the area to which an adjustment is intended will change. The secret to copying a brush created for one adjustment, to a second adjustment, is finding the correct TIFF files and simply moving around some files. Easy!

Well, it’s not quite that simple… A single brushed in adjustment can actually result in many, many TIFF files, each representing your progress in applying brush strokes, resting your hand, and applying more brush strokes for the same adjustment. Aperture keeps all these intermediate “half brushed” files around, so… it’s important to find The One True TIFF for the adjustment you wish to duplicate.

How to copy Aperture brushes

Let’s dive right in and see how Aperture brushes can be copied from one image adjustment to another! For this example we’re going to be looking at one of my recent photos, Clinical study at the Mary Shelley School of Theologic Medicine. In this photo I wanted two different vignette effects — a subtle amount on objects in the foreground, but a much more aggressive effect on the background. I also wanted to apply edge sharpening over the background at different levels than I was anticipating for the foreground. So, for the background: two adjustments; one brush.

  • First, the vignette effect was carefully brushed onto the background portion of the photo. You can see an overlay of the finished brushing below:

Overlay of the brush to apply a vignette adjustment – click to view larger

Painting the adjustment around all of those foreground objects was no mean feat! I definitely did not want to go through that process again when it came time to add in edge sharpening.
  • Quit Aperture
  • Open the Finder and locate your Aperture Library
  • Select the Aperture Library and control-click to show the pop-up menu of things you can do with the selected file
  • Choose Show Package Contents from the pop-up menu to open the folder containing the package contents of your Aperture Library

Package Contents of the Aperture Library

Note that one of the items in the Aperture Library is a Masks folder. This is where Aperture stores the TIFF overlay for the brushed in adjustments for ALL of the photos in your library. If you regularly use brushes in your work, there will be a lot of deeply nested files and folders stored in Masks, and the TIFF files you encounter will not be, simply, “finished” brushes… you’ll also find plenty of work in progress, so it becomes very important that you find the one great and true TIFF file that defines your finished set of brush strokes.
  • Select the Masks folder and choose Find from the File menu
The Finder will display a typical search window from which you can look for the TIFF file that represents the adjustment you want to duplicate. In my case, it’s the vignette effect I just created.
  • Specify that you want to search in “Masks” and you want to search for “Last modified date” is “today”

Searching for the vignette adjustment I just added

The results of my search is shown in the image above. That oddly named file on the right sure looks like the complex brush I just created, doesn’t it? You can verify that this is the correct file by checking the modification date and viewing it in Preview. I like to sort the results by “Date Modified” to make sure I’m finding the most recent version of the adjustment brush.
Update for Yosemite (OS X 10.10)
Good news! The Finder is once again able to search for files within package contents! So, once you upgrade from Mavericks to Yosemite you will no longer need to find the changed masks using the Unix method described below. Yay!!
Update for Mavericks (OS X 10.9)
With the introduction Mavericks it would appear that the Finder is no longer able to correctly search for files within package contents. Boo! Hiss! Hopefully this is merely a bug that will be corrected in a future version of the OS, but for now we need to turn to alternate (and more painful) means of locating the mask for the adjustment we just brushed in… Unix! Yep, if you’re running under Mavericks you’ll have to open the Terminal application and do the following:
  • Move to the directory that contains Aperture’s brush masks. The easiest way to accomplish this is to enter the following into the terminal window:
cd /Users/yourusername/Pictures/Aperture\ Library.aplibrary/Masks
  • Search for all of the files that have been modified during the past 30 minutes:
find . -mtime -30m -ls

The results will be output to Terminal as a Unix file listing, which includes the date and time that each of the files (and directories) was last modified. It should look something like this:

726528 0 drwxrwxrwx 5 jpurlia staff 170 Jan 31 10:10 ./0/0v
5062687 160 -rw-r--r-- 1 jpurlia staff 80706 Jan 31 10:10 ./0/0v/0vnnvhr5TpGemd6ul6ltzg.tiff
733809 0 drwxrwxrwx 4 jpurlia staff 136 Jan 31 10:08 ./s/s7
5062669 112 -rw-r--r-- 1 jpurlia staff 55530 Jan 31 10:08 ./s/s7/s7Hgm3rPQZOtML0rDigiVA.tiff

Yuck, right? From this information you’ll need to look at those timestamps and the path to the file that contains the elusive TIFF file. In the example above, the most recent TIFF file was modified at 10:10AM on January 31st. The information that follows is the path to that file, which we see is in a directory  named:


which itself is inside another directory named:


You’ll then need to navigate to that subfolder within “Masks” to find the file — in this case, the file named:


Yep… pretty darn annoying.

What if you want to find a mask you created earlier in the day? Or yesterday? Or last week? There the task becomes a little more difficult, but certainly not impossible. The easiest approach is to open Aperture, locate the adjustment you wish to clone, and make a slight “non-change” to the brush by either quickly brushing over an area that is already brushed, or (preferred) erasing an area without the adjustment. All that’s needed is one quick touch of the brush and the modification date of the TIFF file will change (even though the brush does not).
  • At this point it is a good idea to make a copy of the TIFF file and move the copy to a safe place for later use. I like to maintain an Adjustment Masks folder (in the Finder’s file system and outside of Aperture) for each of my photos for this very purpose. Don’t forget to option-drag when moving the file, otherwise your original brush will be lost!
  • I also like to rename the file to something that will be easy to find when I want to apply a new adjustment to the same region of the photo. In the image below, the name of the file has been changed to Background Object.
TIFF file after copying from Aperture Library and renaming
We can now focus on creating a brand new adjustment that will use the same brush shape we just saved.
  • Open Aperture
  • Select or add the adjustment brick that is to have the identical brushed region as your saved TIFF file

Adding a new Edge Sharpen adjustment to the photo

In the image above I am adding a the Edge Sharpen adjustment that I only want applied to the background — the exact same region that just received the prior Vignette adjustment.

  • Give your brush a nice wide radius and quickly brush in an easily recognizable shape like a big ‘X’, a circle, or a square

Quick brushing of Edge Sharpen — The shape is unimportant!

There. We have now edge sharpened everything inside the smiley face. Of course, we don’t want to sharpen inside a smiley face; we want to sharpen inside the brushed region we previously created and saved for the vignette adjustment.
  • Quit Aperture (once again)
  • If you’ve closed the previously opened Package Contents of the Aperture Library you’ll need to reopen it and once again navigate to the Masks folder
  • Choose Find from the File menu
As before, the Finder will display a search window where you can look for the TIFF file containing your quick, easily recognizable brush strokes.
  • Specify that you want to search in “Masks” and you want to search for “Last modified date” is “today”

Searching for the quick brush strokes we just made using the new adjustment brick

And there’s our smiley face! (The vignette mask is still there as well, and will be as long as you’re performing these operations in close proximity to one another.) Once again, it is important to verify that this is, indeed, the brush that was just created, so sort by “Date Modified”and make sure this really is the most recent version of your quick adjustment.
We now want to replace the TIFF for the smiley face with the TIFF of the brush we had previously saved.
  • Open the folder that contains our quickly rendered brush by control-clicking on the icon and selecting Open Enclosing Folder from the popup menu

Opening the folder that contains the TIFF for the new adjustment

  • Copy the previously saved TIFF file for the original adjustment into the folder containing the TIFF file for the new adjustment. Again, option-drag is your friend!! You want a copy, not necessarily the original file.

The previous saved TIFF file copied into the folder containing the new brushed adjustment

Getting Aperture to apply the previously saved brush is now just a matter of changing the same of the saved TIFF file to match the name that Aperture had created for the brushed region we just created.
  • Rename the saved file to match the name assigned to the file created for the new adjustment
  • Delete the file Aperture had created for the new adjustment
I’ll leave it up to you, the reader, to apply your favorite steps for renaming and deleting files… but here’s one way to do it using the example above:
  • Select and Copy the name of the smiley face file: %bjGyLKoRLO9K6M06AIP1Q.tiff
  • Drag the smiley face file to the trash
  • Select the name of the saved file: Background Object.tiff
  • Paste to change the name of the saved file to: %bjGyLKoRLO9K6M06AIP1Q.tiff
  • Press ‘Enter’ to complete the file name

After renaming the saved adjustment file and deleting the new adjustment file

As illustrated above, the TIFF file that Aperture will use to apply the new Edge Sharpen adjustment now contains the same shape we’d previously created for applying the vignette effect. Yay!
  • Open Aperture
  • Select the Edge Sharpen adjustment we had previously brushed in with a smiley face
  • Turn on the Color Overlay for the brush, and…


There it is! No need to go through the agony of “repeat brushing” around all of those tiny, tiny figures!
And that’s it for this little foray into technology. I hope this proves useful to you until such a time that Apple adds the ability to copy and paste brush masks in a future version of Aperture.
I’ll be back posting about art and culture soon, though I do have one more pretty cool Trick of Technology up my sleeve for a future post. Think iPad, photography, and illustrated books made easy.

Read Full Post »

%d bloggers like this: