Friday, August 16, 2019

Chip's Notes on Making Still Frame Animations and Timelapse Movies

About 10 years ago I made a bunch of animations (GIFs and timelapse video) from sequences of still frames.  Now I want to do that again, but have pretty much forgotten how.  So now as I rediscover the procedures, these are my notes.

There are multiple ways to do this. I used Vegas Video the last few times. I still have a current license for Vegas Pro, so I could do that.  Another way is through Photoshop.  Since I use Photoshop more often (but not for animation) in my regular workflow I'm going to start out try it that way.

Start in Lightroom

Either way, my normal still-frame workflow always starts in Lightroom.  Here I would first make whatever image adjustments I want.

I am shooting RAW 5760x3840 images on the 5D-III, which result in 17 MB DNG files.  For several hundred frames, these are too large to conveniently animate in Photoshop. So instead I export them as JPEG or PNG.  This reduces the file size, and I could reduce it even more by reducing the resolution.  Standard 4k video is 3840x2160.  To export as JPEG at full size and 100% quality produces a 10 MB file

If I do this, it is best to put them in a separate folder.

Optionally, I can then add them to the Lightroom catalog, and send them to Photoshop this way:
  • Within Lightroom, select the entire set of frames that you want to use.
  • Right click to open the context menu, then "Edit In > Open as Layers in Photoshop...".
But in order to minimize Lightroom clutter, I prefer to leave the JPEGs out of the catalog.  It's still easy to open them as layers in Photoshop using the Photoshop "File > Scripts > Load Files Into Stack" command.

Still Frame Animation in Photoshop

If you have a lot of frames, Photoshop will take a lot of time, but after a while  you should have a single file with as many layers as you have frames.  Now open the Timeline window (Windows > Timeline) and select "Create Frame Animation" from the dropdown menu in the center of the window.

Note that after you select it from the dropdown menu, you have to actually click "Create Frame Animation". This stumped me, solved thanks to Lindsay Kolowich's tutorial.

Select all layers (Select > All Layers).

Using the hamburger menu at the top right of the Timeline window, first select "Create new layer for each new frame".  This is just a checkbox, it won't do anything yet.

Again with the Timeline hamburger menu, click "Make Frames From Layers". This makes each selected layer a frame of the animation.

For me, the order of the frames was the opposite of what I intended.  My layers were ordered in sequence from top to bottom, but for whatever reason the frames were ordered from bottom to top. Fortunately there is a "Reverse Frames" item on the hamburger menu. Solved.

Photoshop allows you to set the display duration for each frame. A smooth animation needs at least 20 fps. I set the duration to 0.0333, for 30 fps. Select all the frames, then click on and set the duration.

In my Las Vegas animation, the first 20 frames are 4 minutes apart. The rest are 1 minute apart. In order to use these in the animation I tried to create 3 tweens between each of the first 20 frames to simulate the same 1 fpm frame rate.  I could not find a way to do this all at once so I individually selected each of the first 19 frames and tweened it with the next frame.  This creates opacity layers for blending, but I couldn't figure out how to make them work correctly, finally deleted them.

If I wanted a GIF animation I could export using File > Export > Save for Web (Legacy).  But I want a video. So I clicked the "Convert to Timeline" button, which was below the playback controls in the Timeline window.  This worked ok, but the result is confusing -- it looks like I have a separate video clip for each frame and they are all overlaid.  Trying to poke into this led to Photoshop bogging down and becoming unresponsive, apparently while trying to save the file. I finally just killed it.

I don't yet understand how Photoshop's tweening really works. If I did, I could do fades and so forth. But I am more inclined to try this in Vegas.

Still Frame Animation in Vegas

I have a copy of Sony's Vegas Pro 13.0 from 2014, now owned by MAGIX Software. After re-registering it, I used File > Import > Media to load all of my still images.

After a little poking around, I just dragged all the stills onto the timeline.  Now I have a video sequence, but by default each frame is displayed for 5 seconds. This can be changed using Options > Preferences. Select the Editing tab, then set New Still Image Length.  After failing to recall a way to change the duration in the timeline after the fact, I just started over, first setting New Still Image Length to 0.033 (1 frame at 30fps).

It was straightforward, using the Time Stretch/Compress tool and Ripple editing, to extend the first 20 frames so that they were each 4 frames long.  This adjusts the overall duration. Then, turning off time stretch and ripple, I dragged the first 20 events so that they overlapped for a cross-fade. This was all done one at a time.

I also tweaked the last frame for a fade-out. Then File > Render As and I was done.

Results

Here is the resulting YouTube video


References

Tuesday, July 30, 2019

Chip's Notes on Star Trails

2019-07-28, Sisters OR.   I have just finished nearly 5 days (3 days of shooting) with Aperture Academy's new Central Oregon workshop, led by ApCad veterans Brian Rueb and Mike Wardynski.  This was my 28th ApCad workshop, but comes after a personal workshop hiatus of nearly two years. Among many other subjects, we shot star trails from the Ray Atkeson Trail at Sparks Lake on the last night of the workshop.

July 27,2019. Sparks Lake Oregon.
I have shot star trails before in two other ApCad workshops:
May 8, 2015. The Pinnacles. The cliffs were light-painted.
June 19, 2016. Tenaya Lake

June 18, 2016. Tuolumne Meadow. Lens correction flattens the horizon, but distorts the star trails into an ellipsoid.
But it has been 3 years since that last time at Yosemite, and the passage of three years has aged more than the batteries in my intervalometer. I remembered very little of the star trail production process.  So this time, as I re-learned the procedure, I've created these notes. Besides helping me to remember next time, they may be of use to someone else.

Basics

With a film camera, star trails are produced by opening the shutter for a long time, say an hour, closing it when you are done.  But a digital camera sensor heats up over time and increases noise on longer exposures.  So star trails with a digital camera are commonly produced from a sequence of much shorter time exposures, say 4 minutes, each containing a portion of the trail.  These images are later "stacked" in Photoshop or a similar app to produce the full trail.

Optionally a "Base" image of the terrestrial elements can be taken while there is still a bit of light, then layered into the final scene. 

Chip's Nutshell Guide to Shooting Star Trails

In a nutshell, do this:
  1. Which way is North? Where is the North Star?  Remember that the stars will seem to rotate around the North Star, so consider where that central point will fall in your composition (if at all).
  2. Get your camera and tripod all set for the composition you want.  Make sure it is secure because you don't want the setup moving for the next few hours. Make sure you have ready access to all the controls without moving the rig. Remember, it will be dark!
    [At Sparks Lake I set up my camera in such a way that I had to balance on some steep lava rocks to adjust things. It was fine in the twilight. But later, while checking the intervalometer during the very first star trail frame, I became a little unbalanced and rocked the tripod slightly. It was enough to throw off the alignment and the first frame had to be tossed.]
  3. While you still have lots of light, also set up your intervalometer.  See below.
  4. Before it gets too dark, shoot a few "base" or "plate" images while you can still make out the foreground and other terrestrial objects.  Later you may want to blend one with the star trails. Otherwise your foreground may be nothing but dark shapes against the night sky.  These should use the same f-stop as the star trails.
  5. When stars become visible, test your focus. Then set it to Manual Focus and consider taping the focus ring with gaffer tape.
  6. Depending on how the camera is set, it may not release the shutter if it cannot auto-focus.
  7. When it's really dark, consider taking some "star point" shots. See below for exposure suggestions. Avoid changing the f-stop. This will give you another option for the finished product, instead of just star trails.
  8. Long-exposure noise reduction: turn if OFF. The delay will interfere with the successive star trail shots.
  9. Now let's make star trails!
    -- Set your camera's shutter mode to B (Bulb).
    -- Set your ISO and aperture on the camera. At Sparks Lake we used ISO 800 at f/5.6 (I don't recall why I didn't open all the way, f/4 on this lens). The duration is controlled by the intervalometer.  We used 4 minutes. Shorter durations will pickup less ambient light in each frame and may be preferred.
    -- Trigger your intervalometer. Let it run for one exposure, stop it and check the results.
    -- Test exposure good?  Restart the intervalometer. Now relax, and avoid shining a light anywhere toward the camera(s).
  10. Some time later ...  stop the intervalometer: you're done with the star trail part! But before you move your camera consider whether a light-painted foreground is called for. If so, then simply open the shutter (you should still be on Bulb), paint the light, and close it.  Check the results (without moving the setup!) and repeat as needed.  Try to avoid adjusting the f-stop.
  11. Finally, before you completely pack up: if it's a nice clear night, point your camera completely into the sky, with no terrestrial elements at all, and grab a few more star point shots.  These could be layered into this or other shots as needed. Good to have.

Intervalometer Settings

You don't actually need an intervalometer -- a stop watch and a cable release with a hold button will do.  But it automates the task of shooting all the star trail frames -- besides convenience it is more reliable than a bored, cold human.  My Satechi WTR-A unit is functionally similar to the much more expensive Canon TC-80N3, with addition of wireless. But it is not currently found anywhere on the Satechi web site, so maybe they've quit making it.

Here are the basic settings on the Satechi:
  • Delay - Initial delay before the sequence starts. For our purposes this can be zero, or perhaps a few seconds to minimize vibration as you step away.
  • Long - Length of each exposure, assuming your camera is set to Bulb.  For this event I used 4 minute exposures as recommended by Mike and Brian, so set it to 04':00". [For some of my earlier star trails I used shorter exposures which of course provide a darker sky. The star trail itself is just as bright, so shorter may be preferred. But it means more frames to wrangle afterwards. Below 1 minute the small gap between each frame may become annoying.]
  • Intvl - Interval between exposures. For Star Trails, this should be as short as possible. The Satechi minimum is 1 sec.
  • N - Number of Frames.  For Star Trails, this would be the total time divided by the interval.  So if you want to shoot 4-minute frames for an hour, then N is 15.  But unless you want it stop on its own, I prefer to either make it a much bigger number, or set it to [--] and just stop it manually when I'm ready to stop shooting.
  • Audible beep - You'll quickly get tired of this and your shooting buddies will tease you. Turn it off.
The Satechi supports wireless control, that just adds several more things to go wrong. For star trails it is better to plug the control unit directly into the camera.

Shooting Star Points

Don't want a star trail?  Just want nice crisp stars?  A few things need to change.  This applies to time lapse stars as well.

Focus

If you haven't already set the focus for stars at infinity, do it now. Check the results and then set focus to manual to avoid changing it inadvertently.  This is also where gaffer's tape would be handy to secure the focus ring.

Long Exposure Noise Reduction

Consider whether you want to turn it back on.  This will cause a delay after each shot, equal to the exposure time.  If shooting timelapse, there may or may not be enough time between frames. I normally keep it turned off.

Exposure

If we don't want the stars to be motion blurred from the earth's rotation, then we can't use too long an exposure.  The venerable "500 rule" supposedly tells us the maxium shutter speed for a given lens. The "500" applies to full-frame cameras, the equivalent is "330" for APS-C crop sensors.
500 / focal length = longest shutter speed (seconds)
So with a 24 mm lens: 500/24 = 21 sec
My widest lens is 16mm.  500/16 = 31 sec 
These are maximum times, but they are too long for pixel peepers like me. For example, here's a 1:1 detail from a shot using 16mm for 30 seconds:


The motion blur is pronounced. It would be usable when displayed at smaller sizes but not at full size.  But in the detail below from the same 16mm setup at 10 seconds the motion blur is nearly invisible at 1:1:


So maybe use "200" or "160" instead of "500" in the rule.  200/16 = 12.5 seconds

Use the widest aperture available on your lens, and you'll need to crank up the ISO compared to star trails. I've used 6400 at f/4, lower is better if you can of course.

Pro Tips and Bonus Points!

  • Canon DSLRs show a bright red light on the back when the shutter is open. It's annoying; consider putting tape on it. You can put a pinhole in it if you want.
  • My intervalometer also has a red light. Same thing -- tape.
  • Bring something to sit on or lie on.
  • Infinity focus: set it while there is still light.  Consider putting gaffer tape on the focus ring so it doesn't budge.
  • Turn down your LCD monitor display. Brenda Petralla suggests also getting red transparent sticky film, cut to size of LCD display, stick it over LCD to preserve even more night vision.
  • Don't carry a big roll of tape? Another Petrella tip: wrap strips of gaffer tape around an old credit card to keep in your bag.

Post-processing

The general sequence of post-processing actions to produce star trails is:
  1. Process the entire sequence of star trail images in, say, Lightroom to adjust color, light dynamics, sharpness, and so forth (see "Lightroom Adjustments" below).  The star trail images should all be processed the same way (use Sync).
  2. Then select all of the star trail images and your desired base layer image in Lightroom.  Right-click and select "Open as layers in Photoshop".
  3. In Photoshop it is convenient to put any base layers at the bottom of the layers list, then group all the star trail layers together. Select all of the star trail layers in the Layers panel and set the "Blend Mode" to "Lighten" ("Screen" can be tried as well).
The night sky should fill with star trails as if by magic, and Bob's your uncle!  A few things to watch out for:
  • The trails should be smooth continuous curves (except for very tiny gaps every 4 minutes).  If there is any discontinuity, then something is wrong: did you include an extra frame or leave one out?  Did the camera move at all during the shooting? One way or another you'll need to fix this.
  • Are there lights from automobiles or other human activities? You may want to mask these out.
Finally, to complete the project:
  1. Merge your star trails layers into a single layer.
  2. Optional: Use standard blending techniques to add the base layer image.
    I have one example where the Blend Mode of the base layer was set to "Overlay", but I don't recall why. 

Lightroom Adjustments

I kept my star trail images "as shot", including a white balance of 4850, but cranked the DeHaze up to 100.  I added Lens Profile adjustments, Sharpening and Noise Reduction. Remember to Sync to all the other star trail images.

Depending on personal preference, you can get rid of unwanted car headlights and so forth here in Lightroom, or later in Photoshop.  I find it easier to do in Photoshop.

Example

Basic Star Trails

Here are the basic trails from the Sparks Lake shoot. There are 15 frames of 4 minutes each, representing 1 hour of time. There would have been 16 frames, but I wiggled the tripod during the very first one.  They have been adjusted in Lightroom as described above, and automobile headlights from a road in the center have been masked out in Photoshop.

Step 1: July 27, 2019. Sparks Lake, Oregon.

"Shooting Star" Effect

Next I create a simple opacity gradient so that the trails appear to "shoot" through the sky.  I want to give the 15 frames opacities from 100% down to about 10%.  A linear gradient is fine. So each step will be about (100 - 10) / 14 = 6.4. For simplicity I just made it 6 and stepped from 100% down to 16%. 

In order for the trails to shoot in the "correct" direction, the frame at the bottom of the sequence (i.e. the very last shot) remains at opacity 100%. Starting with the next to last frame, subtract 6 from the previous opacity value: 100% - 6% == 94%, and so forth.

Step 2: "Shooting Star" effect produced by opacity gradient. The most annoying aircraft trail is also removed.
Not everyone is a fan of this effect. I like it.

Adding the "Base" or "Plate" Layer (No Masking)

The mountains and lake are completely lost in the images shown above. The easiest way to add the "base" or "plate" layer simply puts it below the star trails group, and sets the star trails group blending mode to "Pass Through".



The image below uses a plate taken about 30 minutes before the star trail sequence starts. Exposure 30 sec f/4, ISO 1600.

Step 3a: Adds the "base" or "plate" image. Star trail group blend mode is Pass Through.
You'll notice of course that we've acquired a blue sky, against which the star trails themselves appear less vivid. Also we've acquired individual star points. But the blue sky goes with the lake. It works, I think. By the way, in this case, "Pass Through" and "Lighten" look the same (to me).

An equally simple variant uses "Screen" blending mode on the star trail group. This lightens somewhat more, and certainly shows a lot more of the star trails.

Step 3b: Star trail blend mode is "Screen".
I especially like that this mode expresses more star trails in the lake reflection.

The prime alternative to this approach (that I'm aware of) is to do some masking so that the mountains appear against the black sky.  This would also get rid of the star points. But then what to do about the lake?  This (below) just doesn't work:

Step 3c using masking to "clean up" the sky.
My next version instead uses two adjustment layers to tone down the plate, with a layer mask so that it only affects the plate's sky.



The result is this:

Step 3d uses adjustment layers to tone down the plate's sky, but leaves the lake and mountains alone.

This looked pretty good to me at first. But the next day, I realized there is a lot of fringing around the skyline.  In fact, it's worse than that:

Detail from Step 3d, showing misaligned plate.
Remember that above in Step 2 of the "Shooting" section, I mentioned that I had rocked the tripod during the first star trail frame and had to toss it due to the shift in alignment?  Well of course that also meant that every image before that point had the same shift relative to the later images. That's what we're seeing here.  More work required ...

Final Version

My final version masks out the mountain and land from the star trails and makes separate adjustments to the land and sky+water.  I applied a Median filter (8px) to the sky+water plate image, which effectively removes the point stars.  That's the main reason why there is a separate land image, it was needed to preserve the details.

Layers used in final image
The mask on the Star Trails group is the inverse of the mask on the plate Land image. The plate Sky and Water subgroup does not need any masking.

The final version avoids most of the fringing around the mountain and provides a better blend overall, as well as removing the extraneous point stars.

Step 4: Final image

References

These are just a few references.