Aug 2006

Aperture: Something Missing

IMG_6452r
I have been bitten by a bug in Aperture 1.1.2. It sometimes exports images with parts missing. I've had halves and quarters missed out so far, just a few in hundreds of images. I suspect that Aperture renders using multiple threads or multiple parts of the GPU and somehow fails to reconstitute the image at the end. The worst part about this bug is that the file icon is complete, so unless you actually open up the image file an look at it you don't realize that the gaps are there. I spotted it because my thumbnail pages in the galleries were affected.

I'm running under 10.4.7 on an iMac G5. It has only done this since I started adjusting images.
|

Key Value Coding 6: A Longer Key Path

KVO6 adds two more ivars for two more vehicles. You can download the code here.
KVO6-1
Most of the changes are under the hood. Instead of using an NSDictionary like KVO5 did, KVO6 uses a custom container class called VehicleCollection. VehicleCollection looks like this:
KVO6-2
It has two ivars cars and bikes, each storing Vehicles. This adds an extra level of selection to the key path. Notice that the VehicleCollection has no accessors. The -init code looks like this:
KVO6-3
Notice that to set up the vehicles it uses setValue:forKey: on the Vehicle class. That's because the Vehicle class doesn't have any accessors to use. This brings up another useful aspect of using KVC: KVC does the release/retain for you. When setValue is used, it takes care of the reference counting automatically, releasing the old object and retaining the new one. Less code to write, debug, and maintain.

The application controller uses an ivar called mytoys to store a pointer to a VehicleCollection:
KVO6-4
Now comes the interesting part, accessing the ivars of the Vehicles inside the VehicleCollection. AppController does it this way:
KVO6-5
The key path now has three parts. If the user types "paint", then the first ivar access is to cars.suv.paint. This accesses the cars ivar of the mytoys vehicle collection, then the NSDictionary of the VehicleCollection to find the suv object, then the paint ivar of the Vehicle object. All with no accessors. There is no limit to the length of key paths.
|

Fourteen More Canon S3 Photos

Teddyr

I added fourteen more recent photos to the Canon S3 IS gallery. The thumbnails are also a little bigger and have been split into six pages with twenty images each.

|

Canon S3 IS Sound Recording

Here is a song about a banana slug that I recorded on my Canon S3 IS using the sound recording function. It was recorded at a campfire after the light was too low to get any images. It's a very handy function of this camera.

MP3 192kb (3MB)    AAC 128kb (2MB)

The camera put the sound file into a SNDR folder on the card. I imported the raw WAV file from that into GarageBand so I could trim the ends and add some compressor and export to iTunes for format conversion for publishing. The raw file had no clipping, so the camera must have adjusted the level very well.

To get to the sound recording function, switch the camera into playback mode (as though you are going to look at photos), then hit MENU, scroll down to Sound Recorder and press SET. From there you can record and play back. A 1G card will hold about an hour and a half of stereo at 44.1kHz.

The fastest way to record sound is with the Movie button. Just press it. When you download the movie, extract the audio track using Quicktime or some other software. Not as convenient after the fact and more memory-intensive than the sound recorder. But I do this when I'm not ready for whatever it is that is happening.

The third way to record sound is attach memos to photos. If you take a photo but keep the shutter held down, the image appears in the viewer. While holding the shutter down, press the Flash/Sound button on the top, to the left of the pop-up flash, and a sound recorder will appear for a one-minute annotation. You can do the same thing in playback mode. I've not used that feature, partly because Aperture doesn't handle the sound files.

Here are the lyrics to the song:

Banana Slug
Lyrics by Marty Schafer and Friends at SMOE

You know I love my baby
I like the way she hugs
People don't understand
She's a banana slug

BA-NA-NA-SLUGGGG

She's got just one foot
And she aint got no toes
She just hangs out in the forest
And helps it decompose

BA-NA-NA-SLUGGGG

Now some folks say that she's gross
But I won't hear that jive
If it weren't for my baby
The forest might not survive

BA-NA-NA-SLUGGGG

The way you shake your antenna
You know you give me such bliss
C'mon c'mon c'mon banana slug
Won't you give me a kiss

BA-NA-NA-SLUGGGG

Oh when you slide through the forest
You know you look so fine
C'mon c'mon c'mon banana slug
Let me lick on that slime

BA-NA-NA-SLUGGGG

Banana nana nana slug
Banana nana nana slug
Banana nana nana slug
|

Key Value Coding 5: Adding valueForKeyPath

Download the code for KVO5. KVO5 looks just like KVO4:
KVO5-1
And it does the same thing. The only difference is in the way that AppController accesses the ivars. Here is the new code:
KVO5-2
And here is the code from KVO4:
KVO4-3
KVO5 uses valueForKeyPath once instead of valueForKey twice. If the user types in "paint", it takes "suv" and "paint" and concatenates them with a period to get "suv.paint" and passes that to keyValueForPath. That path is parsed with the first part being applied to the NSDictionary to get the Vehicle and the second part being passed to the Vehicle to get the ivar. It's all done behind the scenes.
|

Another Image Adjustment In Aperture

Here is another adjustment example. This one includes rotation and color balance.

The image on the left is the original and on the right the adjusted version (click on these to view the full-size images):
worigr   wfnalr
This particular image is the best out of a bracketed set that I took of the window. There is a huge contrast between the outside brightness and the inside brightness, so I wanted to have some leeway. The challenges here are getting more detail into the dark and light areas (trees and wall), improving the color so it is more natural, and straightening the lean to the left.
worigr1
The first thing I am going to attack is the color. It's too blue outside and the curtains are bland. So I adjust the color temperature a little in the White Balance section to reflect the morning light that was actually present:
wadjust1
I find the sliders hard to use on a slow machine, so usually either opt for typing in the numbers (double click to select, type, but TAB out of the field -- if you hit Enter you select the Compare image), or clicking and option-clicking the little triangles. Option-clicking increments in smaller amounts.

I also increase the saturation a bit:
wadjust2
and that results in the following:
wadjustcolorr
Next is to play with the Highlights and Shadows to get the wall and trees looking better:
wadjusthsr
Then finally rotate it to get the center straight. To do that add the Straighten adjustment from the + menu first:
wadjust3
I find that numerical is the only way to go with this tool. It is just too slow on my hardware. And the method of straightening is really clunky. Much better would be to let me draw a line that should be horizontal or vertical one the image is straight and let the computer calculate the amount. The result of the slight rotation is below:
wfnalr1
This image is smaller than what I started with. Why? Because straightening automatically crops off the odd triangles that result.
|

Exporting From Aperture With Applescript

User ramonr posted the script below on the Apple Aperture forums. It exports all your images that are in albums in the project you choose. I've not tried it myself.

I have a generalized script - it assumes that any pictures are in albums (rather than in just subfolders) but it will walk you down as many levels as you have.

tell application "Finder"
set location_1 to (choose folder with prompt "Choose a folder to export into") as text
end tell

tell application "Aperture"
set x to name of every project
choose from list x with prompt "Choose a project to export"
set theP to item 1 of result
tell application "Finder" to make new folder at alias location_1 with properties {name:theP}
tell project theP
set initflist to every subfolder
set initalist to every album
if initflist is equal to {} then
processAlbums(initalist, location_1 & theP) of me
else
if initalist is not equal to {} then
processAlbums(initalist, location_1 & theP) of me
end if
processSfolders(initflist, (location_1 & theP)) of me
end if
end tell
end tell

on processAlbums(alist, apath)
tell application "Aperture"
repeat with a in alist
tell a
set theimages to every image version as list
set thename to name of a
tell application "Finder"
if not (exists folder thename in alias apath) then
make new folder at alias apath with properties {name:thename}
end if
set destination to apath & ":" & thename & ":"
end tell
with timeout of 6000 seconds
tell a
set settings to "JPEG - Original Size"
export theimages using settings to alias destination
end tell
end timeout
end tell
end repeat
end tell
end processAlbums

on processSfolders(flist, fpath)
tell application "Aperture"
repeat with a in flist
set thename to name of a
tell application "Finder"
if not (exists folder thename in alias fpath) then
make new folder at alias fpath with properties {name:thename}
end if
end tell
tell a
set sAlist to every album
set sflist to every subfolder
if sflist is equal to {} then
processAlbums(sAlist, fpath & ":" & thename) of me
else
if sAlist is not equal to {} then
processAlbums(sAlist, fpath & ":" & thename) of me
end if
processSfolders(sflist, fpath & ":" & thename) of me
end if
end tell
end repeat
end tell
end processSfolders
|

Key Value Coding 4: Using A Dictionary Instead Of ivars

Download and open up KVO4. Here is KVO4 running:
KVO4-1
This Key Value Coding example replaces the individual ivars of KVO3 with a dictionary and adds a third car. It also replaces the Car class with a Vehicle class. AppController now contains an ivar called cars that is an NSMutableDictionary containing Vehicles:
KVO4-2
The Vehicle class has no accessors.

AppController reads the values out by using valueForKey twice: once to access the dictionary to find the Vehicle, and then again to access the ivar inside the Vehicle object:
KVO4-3
And since the Vehicle class handles the unknown key case by returning an "Unknown: " string:
KVO4-4
we get the same kind of result as we did for the Car class.
|

Aperture Image Adjustments

While I wasn't intending to get into adjusting much, it turns out that I am doing more and more of it. I know that the images that are coming out of the camera are not same as the scenes that I took the pictures of, so adjusting it is.

Look at the two versions of the image below. The one on the left is the original and on the right the adjusted version (click on these to view the full-size images in a new window):
corigr   cfinalr
It did not take all that long to enhance this image, and the results are definitely worth the time. I'm doing this with JPEG images from a Canon S3 IS and using an iMac G5 running Apples' Aperture program. The G5 is slow at doing adjustments, so believe me, I'm not interested in perfection or in doing much to every image.

The original image looks dull:
corigr1
It must have looked more interesting than this when I took it, otherwise why bother? The clouds have little detail and the trees are all dark. The sky is pale.

I do all my adjusting with Aperture in full screen mode (F) with the adjustment HUD up (H). I pick a thumbnail and hit F H and I am adjusting. I almost never use 100% view (Z) when adjusting. There is no point looking at pixels.
cadjust1
The first thing I notice in the HUD is that the full dynamic range is not used. There are no pixels in the image that occupy either the dark or light ends of the range, as shown by the histogram curve not reaching the left and right ends of the graph:
cadjust2
So the first adjustment is to tweak the levels at both ends to match the range:
cadjust3
That results in an image with slightly better contrast, but darkens the foreground trees:
cadjustlevelsr
So I adjust the exposure a little. I move the Exposure slider up by 0.1 and increase the saturation by 0.2:
cadjustexpr
Now the image is brighter and the colors better, but the trees are still very dark and the cloud is all washed out. So I add the Highlights and Shadows adjustment by selecting it in the + menu on the HUD (or more conveniently by hitting control H):
cadjust4
Then I adjust the highlights (for the cloud) and the shadows (for the trees) as shown:
cadjust5
The highlights slider selectively applies contrast to the clouds in this image, nicely bringing out the detail. The shadows slider isolates its action to the foreground tress and lightens them. Here is the final result:
cfinalr1
There is a set of Advanced settings for Highlights and Shadows, but I have not played with those yet. Also notice that I am not sharpening this image. Sharpening is dependent on how the image is output (or reproduced) and at what size, so that is done on a per-application basis, not on a per-image basis. Aperture automatically sharpens on export anyway.
|

Canon S3 or Canon 5D?

S35Dr
J. Vincent has a brief photo comparison of the S3 and the 5D: $420 vs. $5000. What does the extra money (and weight and size) get you in terms of images? Examine the images and decide yourself.
|

Animator vs. Animation

anim
A Flash animation with the creation fighting the creator.
|

Key Value Coding 3: Adding A Custom Class

Download and open up KVO3. KVO3 (again the project is called KVO1) starts a new application, this time with an AppController object and a Car object. Here is what its window looks like:
KVO3-1
You enter the name of the ivar you want to see and its values are shown below when you press Show. The Car class looks like this:
KVO3-2
and its implementation is:
KVO3-3
It simply sets up default values for each object instance when initialized and handles thee undefined key as before. There are no accessors here. If I try an ivar that does not exist, I get the Unknown message again:
KVO3-4
In AppController, I have two Cars defined, suv and convertible.:
KVO3-5
and the code that accesses these is:
KVO3-6
The message valueForKey is simply sent to each of the Car objects to get the values for the fields. And I didn't write any accessor code for the Car class.
|

Aperture: Quickly View Thumbnails In Detail

With a screen full of thumbnails (hit V to make the viewer go away) for captioning or keywording, you can often find yourself wanting to view one or more images for a better look:
quickfull1
There is a very easy way to do this: hit F to go into full-screen mode:
quickfull2
If you have multiple images selected and are not in Primary Only mode, you'll see all of them displayed. To return to the thumbnails, just hit F again.
|

Forty-Seven Minutes with Rowan Atkinson

rowanatkinsonbean
Posted on PistolWimp, 47 minutes of Rowan Atkinson (Mr. Bean) from 1992 as the devil, a headmaster, and others. Classic material from that era.
|

Aperture: Improving Printed Output

Clint Thayer posts at DPReview this advice for getting printer color correct with Aperture:

Aperture is unique in that it contains a wide gamut space natively. There is no need to set up a "color space" within Aperture since it will encompass any space you throw at it.

But- getting the most from it means a few adjustments might be in order. I have found that since I repurchased Aperture, I am getting terrific printed results from it now. But only after I discovered a few items that enabled me to pre-calibrate my entire workflow from image acquisition to final printing.

If you haven't already done so, here are a few things that may help:

1. Recalibrate your Mac Monitor for 2.2 gamma (Aperture loves 2.2 gamma). Use the Mac monitor calibration feature built in to Mac OS if you don't have a custom program to do so. Choose 65K white point. Your clients are likely going to use 2.2 gamma for on-screen proofs, and you'll find a better match between what you see in Aperture and what you print.

2. Choose Wide Gamut RGB in Aperture's proofing profile. This will most closely simulate the cameras widest color range and is the closest match to viewing Adobe RGB.

3. Aperture always converts the color space to sRGB when exporting to JPEG, TIF or PSD. However, there is a single exception: When choosing a RAW Adobe RGB image for EXTERNAL EDITING (round trip to photoshop), the TIF or PSD image presented in Photoshop maintains the Adobe RGB color space- and that expanded color space is brought right back into Aperture as a version when you save.

So, it is best for printing if you can work within the largest gamut possible and preserve the highest level color space. That's why its best to print directly from Aperture and not from an exported version that has been converted to sRGB. And Aperture is the best reason for shooting AdobeRGB in camera.

4. Set up printer color management and presets:

When possible, use ICC paper profiles and TURN OFF printer color management. Aperture's 32 bit engine works best when fully exploiting true paper profiles- and is weakest when using built-in printer color management which can result in some of the complaints we've been hearing about.

I use the Canon i9900- and here is what I do as an example:

A. Open print dialogue box or print presets.
B. Click "printer settings" and TURN OFF printer color managment AND select the proper paper type. Click done.

C. Select your PAPER SIZE in Aperture dialogue.
D. Always choose Portrait or Landscape-- Don't choose best fit (It's unpredictable)

E. Under ColorSync Profile, select the ICC paper profile that matches the paper you are using. In my case I selected Canon i9900 SP1 (which is pro glossy).

F. Make sure Black Point Compensation is ON.
G. Choose a Gamma of 1.15
H. Choose Fit Entire Image under layout options. This will give you the maximum resolution without cropping the image (if that is what you want to do). Or scale the image to a smaller size. Aperture will adjust up or down the native image according to your paper size. Don't worry about DPI or printing resolution. That is accomplished internally according to your settings.

I. Make sure Border Options slider is all the way to the left.
J. Click SAVE AS from the left panel and choose a name for your new preset.

And, while you are at it, do a few more SAVE AS routines for all the paper sizes that you use. So I have set up (4) of them called "Canon Pro Glossy 13 x 19 landscape", "Canon Pro Glossy 13 x 19 portrait", "Canon Pro Glossy letter size landscape", and "Canon Pro Glossy letter size portrait".

Aperture REMEMBERS EVERYTHING under these set-ups INCLUDING your printer settings set up. All you need to do is select your preset and forget it.

Now, load your paper, choose your preset and PRINT. What I have found is the best color matched viewed images to printed images I have ever worked with. And its easy to do.
|

Key Value Coding 2: valueForUndefinedKey

Download and open up KVO2. Confusingly the folder it is in is called KVO2, but the project is called KVO1. C'est la vie. Changing application and project names in XCode is difficult and error prone, so I did not bother. The window does have a new name, however.

KVO1 had the problem that if you type in something that does not correspond to an ivar name, such as george, you get this:
KVO1-5
The bottom field was never updated. And that is because this happened:
KVO1-6
What this is saying is that it failed to find an ivar called george, and so was unable to continue. It looked for accessors first, then gave up and tried to access the ivar directly and that failed too.

There is one change in KVO2. It adds a new method, one that is part of the Key Value Coding informal protocol:
KVO2-1
If the key used (entered in the top field) cannot be found, then instead of giving up, this method is called. It simply prefixes the key with "Unknown: " and returns it as the ivar value. lets see it in action:
KVO2-2
And now there is nothing in the run log.
|

Importing and Exporting Aperture Keywords

Aperture keywords can be imported and exported, but it is not obvious how to do this. There are no menu items anywhere to be found, and there is nothing on the inspector panel of the Aperture main window. Instead, bring up the keyword HUD (shift H) and all is revealed:
kwd1
There, at the bottom of the window are the Import... and Export... buttons. When you export, you'll get a plain text file containing the keywords and tab characters, so make sure whatever editor you use can display tabs correctly. Don't convert tabs to spaces or allow tabs added to the file to be expressed as spaces. The best kind of editor for this is something like SubEthaEdit, or TextWrangler.

Here is TextWrangler's display of part of the file with invisibles turned on so you can see the tabs and newlines:
kwd4
The tabs are used to indent the text to match the indenting of the keyword hierarchy. TextWrangler will let you move whole blocks of text left and right, subtracting or adding tabs as needed, so this is a very fast way to make large changes to your keyword list. When you are done editing, import the keyword list back into Aperture. The list you import will replace the current list, but none of the keywords already attached to images will be modified.

The other list that can be exported and imported is the metadata button list that appears at the bottom of the Aperture window:
kwd5
Again, there is no way to do anything with this information through the menus. Instead you access it through the pop-up:
kwd6
And the following window gives you the import and export buttons:
kwd2
What you are importing and exporting here is more complex than just a list of keywords. Each button set shown on the left pan consists of a list of keywords shown in the middle pane. Each of those has a hierarchy associated with it from the keyword library shown on the right pane.

When you export the button sets you get a plist file instead of a plain text file. TextWrangler shows it like this:
kwd7
Again there are a lot of tabs in the file, but this time they are cosmetic. The structure is encoded in the bracketed items: this is an XML file. It's tough to edit this by hand without making mistakes, so you really need an XML editor to do the job. Apple supplies a plist editor (called Property List Editor) with their developer tools that shows a display like this:
kwd3
Here you can see the nine button sets I have defined and a list of preset keywords that the Actions set defines. On the highlighted line you can see the hierarchy of the keyword I have used (Bombers gallery): it is in Actions > Publish.

Having edited the button sets you can import the new sets into Aperture with the Import button. I have not actually tried this yet. I'm waiting for Aperture to have better and more consistent keyword support, especially for hierarchies before I do anything too complex.
|

Cocoa Programming: Key Value Coding

If you are new to programming in Cocoa on the Apple Mac, then you are probably confused by Key Value Coding, Key Value Observing, and bindings. KVC is all about being able to manipulate instance variable without using accessors. It's very handy to be able to do this because the less code you write, the less there is to debug. It also introduces a whole host of powerful built-in features that, again, you don't have to code for.

The articles in this series each reference an XCode project and are targeted at XCode 2.3 and Mac OS 10.4 (Tiger). The projects are available on the download page and are numbered KVO1 on up. Yes, the KVC articles use projects called KVO because eventually it will progress to KVO.

KVC1: See KVC In Action


The code for this article is called KVO1, available on the download page. This project consists of a single class, AppController that looks like this:
KVO1-2
You can see the three ivars I am interested in accessing: bob, jim, and fred. The idea here is that I will access these without writing any accessors. So the application lets the user specify the ivar by name to display:
KVO1-1
The user types in the ivar name in the top field, presses the Show button, and the bottom field shows the value. That's all it does. Build the project and run it.

Here is the whole of the code for AppController:
KVO1-3
-awakeFromNIB: does the initialization. It does access the ivars directly, and that is OK because the I don't care how the values are initialized. This program is written to show how KVC is used to read values.

All of the interesting stuff is in -show:. name is read from the top field and then used as an argument to valueForKey: to retrieve the string from the appropriate ivar and write it to the bottom field.

The run log shows the string Hello being output by the NSLog line:
KVO1-4
If you type in something that does not correspond to an ivar name, such as george, you get this:
KVO1-5
The bottom field was never updated. And that is because this happened:
KVO1-6
What this is saying is that it failed to find an ivar called george, and so was unable to continue. It looked for accessors first, then gave up and tried to access the ivar directly and that failed too. I will improve on this behavior in the next installment.
|

See Everything With Todos

TodosView
This utility shows you all your applications with a single key combination. Pick the one you want and it will launch it. Mac OS X 10.4 Tiger required.
|

Aperture: Which Vaults Store This Image?

You can easily find out which vaults Aperture has archived individual images into. Select an image and then show the inspector (I). Then look at the metadata section at the bottom. Click on the Archive button bottom right:
arch
That shows the name of the vault (Local250 in my case) and the date and time that this image was updated in the vault. Really the button should say Vault instead of Archive. If you enable the Include In Summary checkbox then the vault information is added to the metadata set selected above, in this case the General set. That lets you display the vault information on screen with the image.
|

One Hundred Photos In The Canon S3 IS Gallery


Diver small sharp
I posted some more photos in the Canon S3 IS photo gallery today, bringing the total to 100 images. All the unmodified originals are provided so you can read the EXIF, peek at the pixels and make your own adjustments. Note that many of the images are taken with the sharpness on the S3 lower than normal.
|

The Last Dinosaur And The Tarpits Of Doom

Here is an article written in 1999 forseeing a wave of Linux taking over the desktop, eradicating Windows as it goes:

"Are you a Microsoft investor? Be afraid. Be very afraid. By 2010 Windows will be as dead as CP/M, and every Windows-based software vendor will be either supporting Linux or out of business. The process is in fact 80% complete: The end result is already obvious to bright CEOs, and will shortly be obvious even to bright mainstream press columnists. In this essay, we will skim the available evidence, extrapolate the trend, and examine some of the mechanisms powering those trends."

Three years to go. Are we getting close? Yes and no.

The author has the desktop completely wrong: it's still Windows. The exponential effect has not materialized. But in the embedded and server worlds, we're already there. And there are actually two desktops to consider; the work desktop, and the home desktop. This essay was written pre-Mac OS X and things are rather different now. I'd wager that it's not Linux that will accomplish this change, but Mac OS X is a good contender.
|

Which Is The Pig And Which Is The Lipstick?

Ars Technica reports that Microsoft is shipping an industrial design kit to OEMs (computer hardware makers) to help them make their computers visually appealing:

'The toolkit, which is delivered free of charge, contains a whole host of suggestions about how to build a PC that will fit with the look and style of Windows Vista. From color palettes to suggestions about how the power and reset buttons should appear, the kit basically describes Microsoft's vision of what a "Vista PC" should look like. The look features "accelerated curves" and "purposeful contrast," among other qualities. "We want people to fall in love with their PCs, not to simply use them to be productive and successful," reads the enclosed booklet. "We want PCs to be objects of pure desire."'

In other words, we want you to abandon your effective, hard-earned brand recognition to our effective, hard-earned brand recognition, so your reputation can sink as low as ours.
|
The Bagelturf site welcomes Donations of any size