Category Archives: Timelapse

Trimming away the Excess (Photoshop)

I created a problem for myself twice and with the Total Lunar Eclipse coming in April, 2014 I suspect I’ll be creating the same problem again.  I wanted to record a time-lapse of the May 20, 2012 Annular Solar Eclipse as well as the June 5, 2012 Transit of Venus.  I used a solar filter and an Equatorial Mount to help me track the sun. Unfortunately getting a good polar alignment during daylight is beyond my skill set. Without good alignment I had to manually repoint the telescope rather frequently. It is not necessary to understand any of the gobbledygook you just read except to know that the sun was MOVING from frame to frame – see the image below.  With all that movement, a time-lapse looks like a jitterbug dance.  In fact, this artsy composite shows just how much the sun moved around in my frame – that is, all over!

Solar Art

Annular Solar Eclipse with un-centered and trimmed frames. AKA Solar Art the “dots” on the sun are large sunspots.

My friends suffered from similar problems and each of them undertook automated solutions to the problem using Photoshop or something similar.  My goal was to solve the problem in a generic way and along the way I learned some useful additional Photoshop tricks.

The Solution

I used the trim feature of Photoshop.  You can find Trim under Image -> Trim.

Trim makes note of the current value of the upper left (or lower right) pixel. It then creates a selection that includes all of the rows and columns that have the same value and inverts the selection. Finally it crops off all of the selected area into the smallest possible rectangle.

An easy way to think of this is: imagine a dark photo with a white frame around it.  By using “trim” the entire white frame will be cut away.  The same approach works if the frame border is black, blue, transparent, and so on.

But there is a catch!  There is no tolerance setting for the trim value so whatever needs to be trimmed must be an exact color match. Unfortunately this presents a problem because even in a photo of a black sky, the black areas are not uniformly black.  Some values may be 0,0,0 but others 1,2,1.  And then there is noise!  Even though you may not notice a difference between two adjacent pixels trim only operates on those pixels that have EXACTLY the same value as the upper left or lower right.

To get trim to work in a reasonable fashion, therefore, we must turn all of the almost black pixels into black (or some other color).  I feel a Photoshop trick coming on here. Our trick is to use a duplicate layer and adjust it to cause it to trim the way we want. We will discard the duplicated layer when we are done.

Trim-o-Matic

  1. Open the image.
  2. Duplicate the image as a new layer.
  3. If the duplicate layer is a smart object, convert it to a raster layer. (To convert a smart object to a Rasterized Layer, open the layer palette, right-click on the duplicate layer and select “Rasterize Layer”)
  4. On the duplicate layer use
    “Filter -> Noise -> Dust and Scratches” with Radius = 3 and Threshold = 3.
  5. Make sure your foreground color is black (x is the hot key).
  6. Use the “Fill” tool (paint bucket) with tolerance set to 40, Opacity 100%, Mode = Normal and no options checked.  Click the extreme upper left pixel. Fill will replace all of the outer area with black. You may want to click multiple times.
  7. If you have some areas that are brighter than the object, you may also want to apply a brightness and contrast adjustment.
  8. Use the trim function on the current layer with all boxes checked and “Top Left Pixel Color” selected.
  9. Trimming changes both the working layer and the original layer below it.
  10. Discard the working layer.

Here are the steps in illustrations.

Rasterizing a smart object

Rasterizing a smart object

PS_DustAndScratches

Dust and Scratches settings

gs_2014-03-23_084744

Filling with black

Filling with black (might need to repeat this)

Dust and Scratches + Fill may not be enough. Fortunately the duplicate layer can be severely adjusted if needed since it will be discarded.

 

Trimming Tool

Trimming Tool

Select Areas for Trimming

Select Areas for Trimming

 

After Trimming

After Trimming

Delete the Extra Layer

Delete the layer that was created for the sole purpose of trimming

 

What If It Crops Too Tightly or Inconsistently?

This set of steps written as an action can be used to automate the process of trimming. There are still a few remaining problems to work out. Sometimes after trimming the total horizontal or vertical pixels of the object the resulting image size will differ by one or two pixels. To solve the “dimension” problem, the simplest method is to use Image -> Canvas Size. Set the canvas to about 20 pixels larger in each direction. Select “center” (the dot in the middle next to anchor) and set the fill color to match the background.

Expand the canvas and center the image

Expand the canvas and center the trimmed image

After Trim and Canvas Size

After Trim and Canvas Size

The above procedure will work quite well for animating a sequence of sun or moon shots – except for eclipses.  Eclipses don’t work properly because an edge of the sun or moon disappears leaving no edge to properly orient with the others.

What can we do when we no longer have constant edges to align with?  Divide and conquer! Instead of trying to apply the same action to all of the images, we will can change edge we select when enlarging the canvas size. We can orient sets of images based on which part of the image remains constant.   Which edge or corner should you pick? Pick the edge that stays the same (if there is one!)  For an Annular solar eclipse, at least one of the directions will never be darkened – that’s the one to pick!  The annular eclipse sequence shows that the upper left limb and lower right limbs of the sun remain present in all of the shots.

Field Rotation

There may still be another problem: Field Rotation. If you’re thinking that perhaps this has something to do with improving crop yields on a farm, sorry to disappoint you. The Annular Solar Eclipse and the Transit of Venus were events that took place over a period of from 3 to 5 hours.  During that period the earths rotation causes the sun, moon and stars to move. It also causes them to “turn” as viewed from terra firma.  You can see this for yourself if you watch the full moon from moonrise to moonset. At moonrise make note of the orientation of the “man on the moon” and compare it with the orientation at moonset. Go ahead and watch. I’ll wait for you.

So what do you do if you have this field rotation?  Either live with it and accept that the animation won’t be entirely accurate, or you’ll have to do a much more complicated set of operations by progressively rotating the images.  That’s more than we want to tackle, so you’re on your own for that!

The Results

The Annular solar eclipse sequence. The Abstract Solar Art image at the top of this article was created from the un-centered and trimmed frames. Obviously this wasn’t perfect – in part due to clouds and shimmer in the atmosphere.

Flying Dust Monsters (and Venus, too)

Not seeing the above video? Click here to watch.

Obviously this one had some trimming errors… and nasty dust on the sensor but this is the once in a lifetime Transit of Venus.

Road Trip: Eastern Sierra, California

Do you know how to get permission” … is how it began.  And this question set in motion a two-and-a-half day trek with 16 hours (800 miles) of driving plus the usual sleepless nights.  The first night found us shivering at Mono Lake.  I knew it would be cold, but it was colder than I anticipated and my 7 layers of clothes were just barely keeping the frigidity at bay.  Unfortunately due to a low fog that crept in and the aforementioned bracing cold, we were unable to hang out until moonrise which that night was to be at 12:20 am.

Takeaway: Always be prepared for 20 degrees lower temperature than the forecast!

After sleeping in, and grabbing breakfast we took a long drive to Bishop by going through Benton and stopping at several Petroglyph sites.  There were some remarkable locations I’d never seen before along the route, including a place that looks strongly like the formations at Alabama Hills.  Unfortunately the photos I took with my Spyglass application were never saved… we’ll be talking about Spyglass in the future, so stay tuned.

Andy stares down #13

Andy stares down #13 as the sun sets.

The second evening we found ourselves at 7,200 feet elevation where clear skies turn a noticeable purple after sunset. But I talked Mr. Mean 🙂 into remaining until at least moonrise which on that night followed the rise of Sagittarius.

The Milky Way rises over the 10.4 meter radio telescopes at Cedar Flat, California.

The Milky Way rises over the 10.4 meter radio telescopes at Cedar Flat, California.

Here is a short timelapse from which the above is taken:

Awake All Night (PS CS6 version) from Steven Christenson

For a slightly different take including an additional sequence, see here.

The Route

8JlVuXD[1]

WIth Tioga pass closed, we traveled through Sonora Pass on the way out and by accident through Carson Pass on the way back.  There was precious little snow anywhere except in Carson Pass.  The area around Caples Lake was particularly nice.

Caples Lake, Ebbetts Pass, California. This is a little bay in the lake the lakes is MUCH larger.

Caples Lake, Ebbetts Pass, California. This is a little bay in the lake. Caples Lakes is MUCH larger.

The shoreline of Mono Lake with a large Tufa formation and stars of the North Western skies.

The shoreline of Mono Lake with a large Tufa formation and stars of the north western skies.

By the way, I’ve referred to Andy as Mr. Mean only because he was insistent that I not pay for the gasoline for this long trip.  I don’t think he really has a mean bone in his body. Meanwhile, you might want to check out his antics on his blog: PhotoshopScaresMe.com

Review: CamRanger

I am always looking for the best solutions for automating my night photography. In fact, I recently reviewed a litany of products. At the time I didn’t know about the CamRanger product – my friend Rob C. told me about it.

I am now the owner of a CamRanger. Here are my first impressions:

IMG_1552

iPhone Application

  1. I ordered from the CamRanger website, selected two day delivery. The box came all the way across the US. From Virginia to California and it arrived in two days. Woohoo! Great store and interaction.  It’s also available through Amazon, but doesn’t qualify for Prime. I figure if I’m going to pay for shipping I’ll order it directly from the company and hope they keep a bit more of the cash.  By the way I paid with PayPal. Sweet. 
  2. The packaging is reminiscent of the iPhone. Everything is nicely tucked into a little box. I was worried briefly because I also ordered two extra batteries. Thankfully they were tucked into the same box.
  3. Included were: Quick start instructions, a charger (wall wart), charger cable, USB to mini USB to connect to the camera, Ethernet cable (for upgrading the firmware), the batteries, a cigarette sized-packet with the CamRanger unit, and a carry pouch with a velcro closure and a carbiner clip.

The CamRanger is an incarnation of the TP-Link portable wireless router. It even says so on the batteries and under the case. Really clever approach! Kudos to them. Of course the firmware has been customized, and they are using the USB connector to drive the camera.  With that arrangement they can do a WHOLE lot more than you can do with a lowly intervalometer.

Essential is the CamRanger application for iPad and iPhone. They are planning to roll out other applications, including one for the PC. Since the device is a portable router, theoretically they could even provide some simple browser driven connectivity.  I loaded the app long before I received the box. You can’t get to square one without the device, however – it won’t show you any of its glorious features until it can talk to a camera. Makes some sense since what you can do depends on the camera it connects to.  I found some blemishes with the application which I’ll enumerate in just a moment.

What Can the CamRanger Do?

Before I criticize, let me first explain what you CAN do with this clever device. And this is just scratching the surface.

  • Focus stacking – let CamRanger control incremental focus for maximum depth of field with your macro (or other) shots.
  • Remotely adjust focus (camera auto-focus must be turned on for this).
  • True HDR using exposure time, ISO or f/stop increments. Up to 7 exposures are allowed.  Intervalometers with this feature can only work in low light since they can only crudely control the camera shutter.
  • Monitor “live view” and captured images. Even delete them when they suck. I am slathering at how this will improve my Astrophotography. Have you ever tried to adjust focus of a telescope pointed nearly straight up – it’s a neck breaker.
    IMG_1556

    Delete Images from Camera

  • Intervalometer functions: timelapse, and bulb exposures.
  • Complete control of settings (how complete depends on your camera). Nearly all of the settings can be changed remotely including ISO, f/stop, exposure time, metering mode, image size and type… and more.  I even moved the connection from my Canon 5D Mark II to my cohort’s Nikon D800 and had immediate control of his camera and its unique settings.
  • Some features do require manually changing the camera mode knob. For example to get bulb exposures you must be in Manual mode on a Canon 50D or in Bulb Mode on the 5D Mark II.  These peculiarities vary by camera.
  • CamRanger can do everything the EyeFi can do for sending images. EyeFi isn’t supported on CompactFlash media cameras so CamRanger is a great replacement!
  • IMG_0137Focus by touching the iPad screen.
  • Provides a Live View Histogram.
Touch the iPad to select focus point!
IMG_0128

Landscape Mode

 

 

 

 

IMG_0127

Portrait Mode

IMG_0136

View images from the camera memory card

What Could Use Some Improvement

I’ve ordered my complaints according to how much they affect the way I do most of my work which is night and astrophotography.  Some of these are nitpicking, I know.

  1. There is no sub-second interval for long exposures. I’d love for them to add a “star trail mode” and select the shortest possible interval between shots based on the camera type and behavior. The company says this is a limitation in what they are able to do through the USB connection to the camera.
  2. There appears to be no way to know if a timelapse is running nor can you stop a timelapse in progress.  The CamRanger can continue to run a timelapse sequence without an app driving it.  That’s a plus. But not being able to tell if it is running or to abort a sequence in progress is annoying. CamRanger tells me they are planning to address this in an upcoming release. Yeah!
  3. The pouch for the CamRanger could be improved to:
    • Hold all the items that come in the kit. The pouch can only hold the CamRanger device, USB cable and perhaps an extra battery – not the additional cables or plug-in charger.
    • Add velcro straps so I can wrap them around my tripod leg and secure the pouch to my tripod,
    • Provide a closeable window so I can see at a glance the unit status (i.e.those LEDs which are too bright, see below).
  4. The timelapse settings use spin dials to select the number of exposures and exposure times. The keypad would be more efficient.  It would also be great if the App automatically calculated your elapsed running time based on the number of exposures and a configurable frame rate (like TriggerTrap does). CamRanger is adding the calculation.
  5. The LEDs on the device are pretty doggone bright for night work. Would be great if they were dimmable. Of course that can be achieved by putting the device in the pouch or by putting some semi-opaque tape over the LEDs.
  6. IMG_1564To interact with the CamRanger, you have to switch your iDevice to the WiFi network generated by the CamRanger. Unfortunately that means you can not use your iDevice browser to surf the internet. If there were some fast-switch way to do it, I’d like that. Or better yet, I’d like to integrate the CamRanger into an existing network.
  7. The CamRanger itself comes with a serial number sticker. I’m SURE it will come off or get lost, but you need that serial number to connect to the device. The same serial number can be found on a sticker under the battery cover, though.
  8. The Access Key to join the CamRanger network is all in upper case.  All lower would be easier to type.
  9. My buddy Rob noted that he felt like he was going go have to break the battery cover off. Mine seems to come off quite easily if you hold it correctly.
  10. The CamRanger battery is a custom lithium-ion form factor. You can charge the battery in-device, but there is no additional charger provided.
  11. Sometimes when switching functions, for example when switching to Timer it told me “must turn off live view” which seems a bit strange since it knows how to do it!
  12. I ended up with both my iPad and my iPhone attempting to connect to CamRanger. It caused a problem that was not obviously solvable (Communication Error) until I realized both of my devices were trying to get CamRanger’s attention.

As I noted, some features depend on the way your camera interacts with the USB connection. I didn’t figure out, for example, how to cause my camera to meter the scene for me so that I could manually adjust my exposure – i.e. what I’d normally do with a half-press of my shutter button.

I haven’t tested the range or battery life as yet. Claimed battery life of the CamRanger is 6 hours. There is, however, no on screen indication of the CamRanger’s current battery condition.

Now That I’ve Used it More…

The problems with not being able to see if or stop a timelapse are more than irritating.  The only way to stop a timelapse in progress is to turn off the CamRanger device and turn it back on. It takes about a minute to come back up and meanwhile since the WiFi from CamRanger goes away, my iPad or iPhone will by default switch back to another known network (my home in this case).  That means I have to remember to also switch WiFi networks or I get “unable to communicate”.  I also noticed that for bizarre reasons which are not quite clear I could start a timelapse, but the camera did nothing.  However I *could* use the Capture button.

But that’s not the end of the pain, unfortunately.

  • The Bulb and timelapse settings are not saved. All settings reset to 0 when a timelapse completes.  If you want to re-run the same program – as I do when I take darkframes after my astrophotography sequences – you have to reprogram everything. That’s tedious.
  • Apparently the interface is not smart enough to know how to do HDRs that exceed the camera settings 30″ exposure time.  On my 50D, for example, an HDR sequence that should shoot at 15, 30 and 60 seconds will not be accepted. However that sequence can easily be achieved by using bulb mode for the last shot and that does not require changing the dial on the camera – so the app could figure it out.  I even tried doing this in “Bulb” mode, but it still didn’t seem to work.
  • The biggest pain in the butt is that the “Autofocus” behavior is not preserved.  What this means is I leave the AF button on on the lens, carefully fine tune the focus, turn it to MF (manual focus mode) on CamRanger and take my shots. If, however I am forced to cycle the CamRanger power it reverts to AF mode by default so the first shot will try to autofocus in the dark – which prevents the camera from shooting.  I’d like to set the default behavior to NOT AF even though I have set AF on the lens.
  • It also appears the timelapse is not aware of the drive mode for the camera.  I often set my camera to the 2-second (or 10 second) delay for two reasons: 1. it lights the self timer on the camera so I know when a frame is about to fire, and 2. In delay mode, an Autoexposure bracket (AEB) will automatically complete from a single press of the shutter. The timelapse settings could know that the minimum delay will be the length of the camera self timer delay (plus perhaps a second).  But it doesn’t use that information.

The good news is that the biggest pain points can be fixed in the app. I suspect some of the more advanced things would require the app to know more about the camera – and are thus less likely to be supported.

The other good news is, it really does save me from breaking my neck trying to get my eye down to the view finder or to view the LCD – when objects are high overhead I’ve had to lay down on the ground to see the LCD – blecch. And it’s great fun to watch the images roll in as the timelapse runs – even from indoors while my poor equipment is out shivering in the cold.

Action! Creating a Timelapse Animation (Part 1 of 2)

One of the nice little benefits of using the stacking technique to create star trails is  that you can take those many frames and animate them.  My first foray into animation looked like this:

Star Races” was created using the stacking features of StarTrails.exe (Windows program) and composed into a movie using the “Animation Feature” of that same tool. The vertical format works well with the portrait mode images. This video contains no music or titling as those are not supported by StarTrails.exe.  I will cover the technique to create this in Part 2.

A more elaborate effort with music, stacking and credits is this one created from 8 hours worth of images using the tool Picasa which is free and available for windows and mac:

Not all time-lapses need be created from night images, however. An early example of a daylight animation chronicles my son scaling a rock in Zion. I later did a similar animation using a tripod. The method used to create the animation will depend on the number of frames available and the intent. Let me start at the beginning however.

Shooting Time Lapses

A time lapse requires “frames” – individual pictures used to create the end result.  Usually pictures used to create a time-lapse will be at relatively low resolution (1920 x 1080 or smaller) so shooting them in large format, RAW means extra work will be required to assemble them.  On the other hand, my time-lapse are byproducts of my star trail shots and I always shoot those in maximum sized RAW mode.  An important consideration is the frame rate – that is the number of images shown per second. A movie typically consists of 30 frames per second, so to shoot 5 minutes of video one needs 30 frames per second for 60 seconds x 5 minutes. 30 x 60 x 5 = 9,000 images. Yes, that is a LOT!  However often a frame rate of 10-per-second is acceptable, so only 3,000 images are needed – still quite a lot.  Perhaps we shall start a little less ambitiously and collect 300 frames – enough for a 30 second animation at 10 frames per second. Assuming we are shooting these at night with 2 minutes each exposure it will take 600 minutes (a mere ten hours!). If that still seems like too much work, we can settle on shooting 1 minute exposures and have the shooting done in a 5 hours.  Clearly patience is required. Unfortunately when shooting the night sky it is unrealistic to expect exposures to take less than about 10 seconds even at high ISO.

The software used to assemble the video may also impose limitations. For example in Picasa’s time-lapse mode the minimum frame rate is 6 per second and the maximum is 24. In “Dissolve” or “Cut” mode, the minimum is 1 per second.  The Zion climbing shot is done in Dissolve mode.

Animation Software

Lots of tools exist for this. I’ve already mentioned Startrails.exe and Picasa (Mac or PC), but there is also Windows Live Movie Maker. Each of these tools is free!  Windows Live Movie Maker is the most versatile free tool I have tried with titling and transition options.

Non-free tools for the PC include Adobe Photoshop, Adobe Lightroom, Adobe Premiere. For the Mac there are iLife (iMovie), Final Cut Pro, and many others.

Music, Copyrights and Credits

While a simple time-lapse may be interesting adding music makes it more so. The free tools support music in some (small) fashion but sometimes just barely. Picasa for example will let you select an MP3 song. Unfortunately when creating a time-lapse it will not let you select where to start in the song and does not fade in or fade out – and only one track is allowed.  If you really feel ambitious you can use iTunes to create a segment of a song to include.   Search Google for “creating ringtones in iTunes” (which will help you figure out how to create a snippet), and “export iTunes as mp3”. Creating a snippet using iTunes is not particularly easy, fast or convenient, but it is free – and as a bonus you will discover that you have been wasting money paying for ringtones!

Copyrights and credits can be done in several ways. Live Movie Maker is actually pretty easy to use and allows different text effects. In Picasa you can use captioning (which is only modestly useful for a time-lapse) or text overlays using the Text Tool. The Text Tool is the most versatile but unfortunately in Picasa you can not say “repeat this frame for 5 seconds”, you have to make 5 seconds worth of frames from one image, or keep adding the one image into the movie. If your frame rate is 20 frames per second, you will have to make, gulp, 100 frames for that 5 seconds of copyright or credit!

Creating the Animation

In the next installments, we will show how to use Picasa from beginning to create a time-lapse with music, titles, and credits.

The first 180 images used in the time-lapse are these:

180 of the 675 frames used for the animation

While the title and credit frames looked like this

Title and Credit Frames