awholenother

Somerville running routes

Blending modes in javascript

I spent quite a while today trying to get the core set of blending modes to behave the same way in javascript as they do in Photoshop. There are only a handful of actual code example results on google, and a lot of them just…don’t work. Even the wikipedia page wasn’t terribly helpful. Finally, though, I got them all working. A few differ from PS a bit, but that may just be a color space thing when I was comparing them side-by-side.

These should read pretty easily. They handle a single color channel at a time (so some of the more complex modes wouldn’t work this way, eg if they need to convert the entire pixel the HSL). Base is the bottom layer color value, and adj is the top layer.

var blenders = { normal: function(base, adj) { return adj; }, darken: function(base, adj) { return Math.min(base, adj); }, multiply: function(base, adj) { return ((base * adj) / 255); }, colorburn: function(base, adj) { return adj <= 0 ? 0 : Math.max(255 - ((255 - base) * 255 / adj), 0); }, linearburn: function(base, adj) { return Math.max(0, (base + adj - 255)); }, lighten: function(base, adj) { return Math.max(base, adj); }, screen: function(base, adj) { return (255 - (((255 - base) * (255 - adj)) / 255)); }, colordodge: function(base, adj) { return adj >= 255 ? 255 : Math.min(base * 255 / (255 - adj), 255); }, lineardodge: function(base, adj) { return Math.min((base + adj), 255); }, overlay: function(base, adj) { return (base < 128) ? ((2 * base * adj) / 255) : (255 - (2 * (255 - base) * (255 - adj) / 255)); }, softlight: function(base, adj) { return (base < 128) ? (((adj>>1) + 64) * base * (2/255)) : (255 - (191 - (adj>>1)) * (255 - base) * (2 / 255)); }, hardlight: function(base, adj) { return adj < 128 ? (2 * base * adj) / 255 : 255 - ((2 * (255 - base) * (255 - adj)) / 255); }, difference: function(base, adj) { return Math.abs(base - adj); }, exclusion: function(base, adj) { return 255 - (((255 - base) * (255 - adj) / 255) + (base * adj / 255)); }, subtract: function(base, adj) { return Math.max((base - adj), 0); } };

There are a few more easy ones I need to get to still (vivid light, etc). And then I may try to do the harder ones.

Sports photography

Lightroom post-production workflow

Thanks to tools like Aperture and Lightroom, what happens to photos after they come off the flash card is now much more predictable than in the past. Whereas it used to be that just about everyone had a different way of organizing their digital negatives, choosing formats, keeping track of originals and edits, and doing all the other things that need to be done to get a final product out the door, these types of applications have adopted a convention-over-configuration attitude. Even though lots of little choices are being made by the software, in general they’re making them in a transparent way, and still leaving some of the specifics up to the user.

It’s not to say that as soon as you choose Lightroom instead of Aperture you’re stuck with one workflow for the rest of your life. There’s plenty of flexibility built in so you can do things one way for the weddings you shoot, and a completely different way for managing your family Christmas snapshots. The niceties that you don’t have control over are the things like catalog metadata management and handling multiple versions of a single photo; things you probably don’t want to be dealing with anyway.

I’m going to go over just one workflow, that I commonly use for dealing with sports photography, but it is basically destination agnostic and could probably work well for any workflow that starts with a large volume of images coming in at one time. I will talk a bit about how I manage my files on the hard drive, the ways I use various features of Lightroom, and some of the custom conventions I have decided on that help me get things done.

File management

I use a very simple solution for keeping track of images on my hard drive. Inside an Archive folder, I have a separate folder for each year, and one extra folder called Singles. Singles is used to keep hold things like photos I take with my cell phone, a shot of the sunset I took while at a football game that I don’t want in the same place as those sports images, etc. Within each year-specific directory, I don’t do any further subdividing to hold individual folders of images. Even if a single year ended up with 200 different child folders that would be easy enough for me to handle, given how infrequently I am actually dealing with these folders and files in the Finder itself.

As much as I try to stick to conventions for things I do on computers, naming the specific folders is one area where I say “whatever works” is better than trying to live within a specification (even if it were my own). Each folder name begins with a date (2009-09-18, for instance) and then a brief description of the event. With sports I almost always put some indicator of the sport right after the date (TF, Soccer, etc) and then a description of the event. Sometimes I will use “TeamA @ TeamB” notation, and other times I’ll say “TeamB vs TeamA”; whichever team is more important to me I’ll put first (if I’m getting paid by or just covering one team, for instance).

I will get all my files organized in their original raw format, and then at some point get them converted over to .dng. There are plenty of other places were the merits and possible caveats of that format are discussed, so I won’t go into them here, but it works well for me. I do not include the original raw file in the negative when I make the conversion.

I will say that while this setup works perfectly fine when browsing my archive in the Finder, even with a single year having many many events, since the list in Lightroom directly matches the folder structure, once you get more than 30 events in a single year scrolling does become an issue. I have thought about breaking years down into quarters just to help reduce scrolling for the times I need to go back and forth between events, but that doesn’t happen too often, so as of yet I haven’t.

Lightroom

First phase

When I’m adding a new folder to Lightroom, I don’t do too much in terms of adding presets or metadata during import. I will add some IPTC copyright info, and a basic set of keywords, but that’s about it. There are only a few venues that I have specific develop presets for, and even then sometimes I will just start the developing from scratch to eliminate the risk of all my shots from different days and different events looking the same.

Since I’m usually coming home with between 700 and 1,200 images, letting LR generate large previews for every shot can be time consuming, and even just leaving that process running in the background, I find, slows what I’m actually trying to do down too much. So I will cancel that process unless I really have lots of time to kill before getting to work.

Second phaes

Now I start the most mundane part of my workflow: going through each shot one by one and making some initial decisions. I find that without waiting for a full-size preview, or even a minimal preview, to render, I can save loads of time marking some shots as ‘rejected’ from just the super-pixellated preview that first comes up with I select a new image. I’m not trying to save time at the expense of making mistakes, so if there’s any question about what the photo will look like I’ll wait the two or three seconds for the full render to come up, but not waiting to mark maybe the 25% of images that are completely out of focus, have a ref passing in front of the camera, or are just obviously not up to snuff is a huge bonus.

During this first run through of all the images, I will mark rejects, as I just talked about, and mark any shots that I think have potential of being delivered as ‘picks’. Even if I have a 10-shot sequence of the same moment during a game, at this point I may pick four or five of them that I like. During this process I don’t like going backwards at all, so if I see one shot and pick it, and get to the next one and say “oh this one’s better” I’ll just pick it and move on, I won’t backtrack and un-pick the first one.

I will also say I don’t like using auto-advance, which in Lightroom will move from one shot to the next as soon as you flag it. Sometimes I get a little trigger happy and hit P instead of X, and when it moves automatically I find I catch those errors less often. Also, when you want an image to remain unflagged (which is most images in a set of 700, for me, from a game), then you have to hit the U key to unflag a photo that didn’t have a flag to begin with. I do wish there were some set of keys on the keyboard that had Reject/Unflag/Pick physically next to each other, but until that happens I will stick with using the arrow keys to advance.

Third phase

Once I reach the end of the photos, I delete (from disk) all my rejects. It’s probably a good idea to give them a once over before you actually hit delete just to make sure nothing you wanted slipped in, but I like getting them out of the way early; less chance they get bulk-selected by accident at some point and I waste time waiting for a couple hundred extra images to convert to dng or apply some metadata.

Now I filter down to just my picks and really start making decisions; it’s also where I start using color labels to help organize things even further, so I’ll spend a second talking about those.

Color labels

The color label set I use for almost all my sports post-production is called my “Mass-ingest workflow” custom color label set. It works well with any large volume of photos that are being whittled down considerably to a select group of deliverables. From Red to Purple the labels are: Reevaluate, Correct, Finalized, Export, and Special consideration. They are pretty self-explanatory, but some of the thinking behind them is that each is pretty much mutually exclusive, so there’s never any overlap, and, except for green/finalized, they are temporary; I don’t really like having my library look like a rainbow. These labels are not set up as a progression; most images will never be red/reevaluate or special consideration. They are just there if I need them and they can help move things along.

I should mention that Export and Finalized do pretty much always overlap, but I use blue/export just-in-time when I’m actually getting ready to move some files out of LR. So, for instance, of 35 finalized (green) picks from an event, I may only want five to put online. I will go through and select those five by switching them over to blue, export, and then immediate switch them back to green. If that collection of photos needs to be retained more permanently, I will make…a collection!

Ok so back to the workflow, as I review the picks, I will look at individual images and either unflag them in I am certain they’re unusable, mark them as red/reevaluate if I’m still undecided, or mark them as yellow if I know I want to spend time editing them. For the shots from a single sequence, I will see which one is the best and, almost always, unflag the others. Every so often multiple shots from a single sequence make it through.

Fourth phase

Once I have everything set as either yellow or red (I know it seems like I spend a lot of time color-coding images, but it’s really just making a decision I would be making otherwise more visual, I’m not really spending any extra time to make sure my colors are correct) I will start to develop. Most times I can come up with a set of base develop settings for the entire event, or at least a large chunk of the event, that I can apply to lots of images as I go and just make some small tweaks to. I’ll copy that set of settings (not make a preset, since I’m generally not reusing these settings for other events), and as I make the image specific fixes (crop, straighten, spot corrections, etc) I’ll just command+shift+v and make any changes I need, usually to exposure or sharpening.

Most times the games I’m covering are in the afternoon and outside, so the lighting conditions are changing quite a bit from beginning to end. In those cases I’ll develop a couple shots from the beginning, a couple from the middle, and a couple from the end, and use those three different base settings to work with the remaining shots. Otherwise I find myself trying to use settings from an early (sunny) shot to start working with a shot from later in the game and realize that it’s very tough to get things right by making lots of little tweaks; it’s better to just force yourself to start from scratch and develop specifically for that shot to get the best results.

Now is probably a good time to mention that if I come across I shot that I want to include in my deliverables for a given job, but also want to go back to later and maybe try as a black and white or some other process that isn’t appropriate for the client, I’ll mark it as purple/special consideration. Sometimes I’ll actually make a virtual copy and set that to purple, but either way I just want to remember to go back and try something with that shot.

At this point I should be getting pretty close to having all green/finalized images. It’s time to make final decisions on any red/reevaluate photos I still have lingering around, and any editing (yellow) that I had been putting off, maybe because I needed to actually bring the shot into Photoshop, or spend a lot of time making spot corrections. Once I’ve got green across the board, I can do whatever it is I need to with the images that made the last cut: export to the web, print, prepare for inclusion on a DVD, etc. I’ve already talked about how I use my blue label to help with that.

Someone reading this is probably thinking “don’t ‘pick’ and ‘green’ mean the exact same thing at this point?” Yes, in most cases they do. And to be honest, a most times if I have a folder of images and the only color label being used in it is green, I will just unset them and rely on their flag status to let me know which ones I like (remember, I said I don’t like having colors in my library). If I’m doing something more long-term, like building one set of images that will be printed, and a different set going to DVD, I may even start re-using the color labels for arbitrary selections that don’t match their label. But eventually, I will almost always remove all the colors.

Clean-up

Once I’m done editing and all my images are ready to ship whenever the need arrises, I’ll do some last minute clean-up. I will go through and make sure my IPTC data is complete, I will do a more specific round of keywording (instead of just ‘soccer’, I will add ‘goalie’ to the appropriate shots), and maybe even go through and delete (from disk) some more of the unflagged shots that are just a little soft, or I know that in a million years I’m never going to need. In general, though, I save all the images I don’t actual deliver. Space is cheap, and it’s not really worth my time to risk deleting an image and then later realizing it was the ONLY shot of #18 for that whole game and regardless of how boring it is you still need to print it out.

Generally I won’t rate any images (with stars) at this point. Unless I think the shot is THE BEST EVER!! I would rather wait a week or so and look at the whole set again later, or get some outside feedback before I start saying some shot is in the real top tier of all my shots. Even then I will start every image out at one star and over time increase it if I feel it’s necessary. Such a small percentage of all my shots have any rating at all that it really doesn’t matter too much what the actual value is. Doing a quick star filter gives me a nice, small sampling of exceptional shots.

That is a pretty complete run-through of just about every sports event I process. I’ve used a very similar process to end up with two shots for a single client, and also 1,000 shots that I used to create a stop-action video. Like all workflows, it’s a very personal thing, but I think Lightroom does a good job of limiting the number of ways that you can rate and organize, while letting everyone do things the way that best works for them. If you’re even a little familiar with Lightroom, you should be able to understand how I’m using this system and hopefully why, and maybe it can help you work a little more efficiently in your own endeavorers.

Joby Gorilla pods

SLR and SLR-Zoom as remotes

I recently picked up a couple Joby Gorilla Pods, which, if you’re unfamiliar, are small tripods built with segmented, rubberized legs that articulate allowing you to stand them up or clamp them to just about anything. They come in several sizes, each with a different weight allowance, and the two I got were the SLR (800g) and the SLR-Zoom (3,000g). I’ve found the names most accurately describe the model below whichever they’re trying to; the SLR model can certainly hold even a large SLR sometimes, but there are lots of cases (read: most) where it’s just too weak. Likewise with the SLR-Zoom, I can fiddle with the configuration of the legs and find a way to support a D700 with a 70-200, but most setups will just topple over; it will hold any SLR with a smaller lens just fine though. The weight recommendations are pretty precise though, so go by those and not the names and you’ll be fine. I bought each Pod with a pretty specific purpose in mind, so I took the gear I was planning on using with each and weighed it before making any purchases.

Firstly, I was looking to get a small, portable, versatile support for was to hold a remote strobe. This could be in a gym replacing the standard magic arm or super clamp, or outside where you can use just about anything to hold the pod: a tree, a fence, the ground, etc. The beastly Sb-900, with batteries and diffuser, weighs in at 545 grams, way outside the range of the Original Gorilla Pod. The next step up is the SLR, so having the 200+ gram allowance was certainly OK with me. B&H (and I’m sure others) sell a kit that includes the SLR, which includes a built-in quick release system, and a hot shoe insert for that QR, so out of the box for $40 it was ready to do what I needed it to. The SLR model has two articulation segments above the legs, and each of the three legs has 10 segments.

Just as a matter of stress testing, I figured the legs are the weakest when they’re straight, so I checked what the most extreme angle this could handle with an SB-900. 90° is straight up, and 0° would be horizontal. In each test I held the only the last two segments furthest from the head, so there was nearly as little support not coming from the strength of the links as possible. Holding one leg by the last two segments at 90°, the pod is surprisingly steady. Even with a little shaking, the leg held its shape. Once you tip the setup even 3-8° it fails pretty dramatically. If you add in a second leg, again holding them by the last two segments, you can get maybe 15° before they start to curl over. With the third leg, though, 90° is a piece of cake. I won’t say rock solid, but very, very solid is definitely applicable. You can hold the whole setup parallel to the ground probably forever and it I think it would hold it’s shape.

Now obviously those tests were not very telling of any real world application of the device, since normally the legs will be tightly wrapped around something providing a lot more support than the last two segments of each leg alone can provide. You can also set the Pod up as a small tripod, and there, too, it provides adequate support. If you keep the legs perfectly straight, and keep them within maybe 25-30° of perpendicular to the ground, the won’t have trouble supporting the SB-900 regardless of how it’s positioned on the head (the whole thing may topple over if put too much weight in between legs, but that’s gravity, not the Pod). Once you get past 30°, you’ll start to see some slumping in the middle of the legs if you try to keep them perfectly straight, but you’ll quickly figure out ways of bending them to create more ground contact, and give them more of an natural arch, and they’ll be perfectly fine. Except in these extreme testing cases, there will always be a way of creating a rock solid support for something as heavy as a SB-900.

The SLR-Zoom model, rated at up to 3kg, looks significantly beefier than the SLR model, and does not include any segments above where the legs join. Instead it has a screw mount for a compact tripod head. BH offers a $60 kit that comes with a pretty OK Slik (SBH-120) ball head, which is what I picked up. As far as I can tell the head will surpass the Pod, so I’m not going to test it’s limits specifically; I haven’t seen it budge a bit with anything up to 3kg when really clamped down.

I mainly was looking to use this Pod as a remote camera support, again much like a super clamp would be used, but even with having never used a Gorilla Pod, I was hopefully it would eliminate the need for having both a clamp and a small tripod for different situations. My testing was done using a D700 (1100g, with battery), and MB-D10 grip (500g with a Kosmo battery) and a Nikkor 14-24 (1,014g) totaling 2,628 grams, or 88% of the 3k limit.

The SLR-Zoom did not do as well as the SLR in the extreme tests. Holding all three legs about halfway up provides enough support to keep the setup parallel to the ground. Anything less than that is just about useless. Even when I tried to setup a regular tripod shape with this much weight on it, it collapsed, or at least started to bend pretty quickly. If I let it sit for a few minutes, it just kind of slowly melted all the way to the ground. Since I wanted to use this as a set-it-and-forget-it kind of remote, I needed to find some configuration of the legs that was stable enough to allow the ball head to hold the camera even at a pretty extreme angle. Even splaying the legs out at 120° flat on the ground resulted in lots of toppling over unless you got things just right. Eventually I found that if you curl the legs up, creating sort of a Mickey Mouse shape, with each curl being as flat on the ground as possible, you get a very, very stable support at most angles and with quite a bit of leniency in how precisely everything was arranged. If you really tilt the camera back on the ball head, putting all the weight over just two of the legs (so the lens is looking straight up at the sky), I haven’t found any way to get the Pod to hold that on it’s own (and not due to just toppling over, the legs are actually giving out). If you set the legs up in just the right way, and put something heavy enough on the front leg as a counterweight, you can do just about anything.

I also have done a bit of testing with a Nikkor 70-200 on the SLR-Zoom, and if you mount the ball head to mounting hole towards the back of the collar mount you can get a pretty good range of angles, but the weight distribution changes when you move things around, it’s not really that stable in general. You should be able to get just about any angle you want if you mess with different leg configurations and which mounting screw hole you choose.

Both of these Gorilla Pods live up to the technical specs that they are listed at. Like I mentioned before, the names are a bit ambitious, but that’s really a non-issue. They are versatile, allow you to place strobes or cameras even where other dedicated supports like a super clamp might be tough or impossible. The trade off is obviously with support and security. I would not be trusting one of these to hold a remote on a catwalk; even if you’re doubling or tripling up the security straps, the potential even just for not getting the images you want is probably too high to not invest in a more dedicated solution. Also, I will have to see how much strength these lose over time with use. I haven’t heard anything like that happening, but I also haven’t heard of too many everyday professionals using these as part of the regular gear, so they may have not been tested enough to make that conclusion yet. I certainly think for the price, and specifically for the uses I got them for they will serve their function well, now that I’ve figured out their limits and the best ways of using them.

2009 MIAA T+F indoor state finals

Film from stills

I put this together using about 700 of the 1100 photos I took last Friday at the meet. I had put together a similar video from the previous week, but this time I shot the event basically with this as the final result in mind, so I put a few hours of work into it. I had to chose between shooting JPEG and not worrying about space on my cards, or going with RAW and having a better chance of offsetting the terrible lighting is post. I went with RAW and just barely got away with it; I walked out with 6 photos remaining on 13gig of cards.

2009 MIAA All-State Championships T+F Championships in 90 seconds from Chris Kalafarski on Vimeo.

After getting everything into Lightroom, I knew I wasn’t going to spend the time going stack by stack and getting the exposure and WB perfect (there was a pretty big variation from one side of the track to the other) so I made up a preset that was a good compromise in most cases. The first time through the photos I eliminated stacks that I knew weren’t going to make the final cut; either there were too few keepers to make a good motion picture of the race, even with more manual editing the colors weren’t going to be saved, or the shots were too similar to others (back to back heats from the same location) that would have just made the video boring.

I ended up with about 80 “takes”, which I went through photo by photo and cropped and did any final developing. When cropping, I made sure each stack visualized a nice movement of the focused runner across the frame. This was tougher in head-on shots, so getting a progressive scale was more important there. I also dropped some unnecessary frames from the beginning and end of certain stacks. At this point all the frames that ended up in the video except for about 10 were finalized.

I exported to JPEG and brought all them into After Effects. I wish there were some sort of ‘export stacks to separate folders’ option, which would have saved a lot of time in the next step, but oh well. I dropped the whole bunch into a comp, sequenced them, and then when through stack by stack and pre-comped them, so it would easy to reorder things. For longer races where I had four or five takes, they all ended up in one comp. I overlooked the timecode at this point, and ended up with comps at 30fps and each image was three frames. It obviously made more sense just to have each image be one frame and drop the frame rate to match the image rate (I decided to be 7, maybe could have gone with 6 to slow some of the quicker shots down).

So after going back through and fixing that, I found a few races that had several heats, meaning I had a single athlete running the same thing, but from different angles. I spliced them together to make things more interesting, and also to decrease the number of times a few athletes/teams showed up, because it was somewhat out of balance. After mucking around with the order of clips for a while, I found something I liked, so I synced up the music, added a title and called it a wrap.

Total time was probably about four or five hours. If I were to do it again I could probably get the same quality in about three hours, but would probably do a little more work in Lightroom to get the colors and cropping a little more consistent.

Phottix Kosmo

The EN-EL3e battery that comes with D300 can only get the camera shuttering at six frames a second, and let’s be honest, that just isn’t fast enough. Dropping another few hundred dollars to get the EN-EL4a and charger to get up to nine fps is a little ridiculous, though.

Enter the Phottix Kosmo. Not only is it a battery on par with the EN-EL4a, getting you those last few precious fps, but it also does away with the need for the BL-3 battery chamber cover required to get the EL4 to fit properly in the MB-D10. The rest of the story gets pretty sketchy. The Kosmo’s main hangout is eBay, and they are shipped straight out of Hong Kong. Shipping takes a good while, and I wouldn’t expect too much tech support if something were to go wrong with this guy.

The charger is pretty unusual for a camera battery. Instead of the standard cradle approach, it just have a little cover over a DC jack, so you plug an adapter right in. This sounds convenient, and considering you don’t need to carry around another bulky (in the case of a EL4, a very bulky) cradle since you’ll probably still be using an EL3, I guess in a way it is. But the thought of having a strange power cable plugged directly into a battery still in my camera doesn’t sit well, so I always end up taking the battery out to charge it. The included AC adapter has EU prongs, so you’ll need a travel adapter, and that’s been nothing but inconvenient. I found a US adapter of equal wattage and voltage in my box of cables, but the jack was too large for the plug on the Kosmo. The larger jack that I had seemed to be standard, so I don’t know where they found the adapter that was included. My last big gripe with the battery is that the little rubber cover protecting the DC jack doesn’t instill much confidence in the way of weatherproofing. I think that when it’s seated properly it will do a decent job of keeping out moisture, but it doesn’t really have the grippy feeling other rubber covers on electronics have, so I go out of my way to keep on a on it and make sure it’s where it should be.

I haven’t done much in the way of testing capacity, or compared it to the EL3 (and I don’t have a EL4). I would say it probably runs out a little more quickly over the same number of frames, and a lot more quickly over the same time period — those three extra fps add up.

Lastly, nine frames every second is silly. But fun.