HTTPS SSH

Shine a Spotlight on Those Photos

This script simulates shining a moving, narrow beam of light onto a photo, making it dynamic.

The script has certain dependencies:

  • The Pillow library.
  • ImageMagick
  • Python 2.7.x (it may work on older Pythons, but I did not try it out).
  • ffmpeg to convert the frames to a video file. You may use any other program as well.

Creating The Frames

To use it on your own photos:

  • Edit the input_fn variable to point to the photo.
  • Change MAX_WIDTH and MAX_HEIGHT as you see fit. I picked values corresponding to 1080p video.
  • Change TIME to indicate how long you want the video to be.
  • Changing the formula that calculates delta to modify the speed of the spotlight (change 2.3 to something else).

Run the Python script.

Creating The Video

When you run the script, the frames will be under mov in the same directory.

Navigate into the directory, and run:

ffmpeg -framerate 30 -pattern_type glob -i '*.jpg' -c:v libx264 out_file.mp4

Or use any other tool you desire to convert the frames to video.