A 360° photo collage in minutes using Photoshop and After Effects scripting

We spend time researching ways to optimize the production process. One way we do this is by automating complex and repetitive production tasks. Doing so allows our designers to focus on creating rather than wasting energy on brain numbing tasks.

In this demo, we will be demonstrating how Photoshop and After Effects scripting can be used together to quickly create this rotating photo collage.

Part 1: Run the Photoshop script

Download and unzip the project files. The first script we will run is called "collage-setup.js". This Javascript creates a collage of randomly placed images. When the script is run, the user is prompted to select a folder of images from their computer. The script then proceeds to create the collage by opening each individual image, and placing it in a random location within a Photoshop document. Once all of the images are processed and placed, the script prompts the user to save the resulting .psd file in a folder of their choosing.

  1. In Photoshop, browse to File->Scripts->Browse. Then browse to the folder where you unzipped the project files, select "collage-setup.js", and click "Load".
  2. You will then be prompted to select a folder on your drive that contains some .jpg, .png or .psd files. For best results, try a folder with at least 20 images.
  3. Once you select a folder, the script will loop through each of the images, resizing them and randomly placing them into a collage. The time it takes for the script to run depends on the number of images in the folder, their size, and the speed of your cpu. This is a non-destructive process, meaning your original images will remain untouched.
  4. You will then be prompted to save the image as collage.psd. Once you choose a location for the image to be saved, the script automatically closes the file. Feel free to re-open and view the file. You should end up with something like this:
The output of the Photoshop script

Part 2: Run the After Effects script

In this second step, collage.psd is imported into an AfterEffects project as a composition. A second script is then run within AfterEffects to further process the PSD file. The script sets each layer as a 3d-layer, and then places each layer at a random position on the Z-axis.

  1. Create a new AfterEffects project.
  2. Import collage.psd into AfterEffects as a composition.The import file window.
  3. Your project should now look like this:The After Effects file at this point.
  4. Browse to File-Scripts->Run Script File. Then browse to the folder where you unzipped the project files and select "z-randomize.jsx". This script sets each layer to a 3d-layer and randomizes the z-position of each layer.

You now have a 3d collage. Create a camera, and move and pan it as you wish. We created a camera and moved the camera in a 360 degree orbit around the collage.

Although this is a very simple example, is demonstrates the power of scripting within Adobe applications, and how it can be applied directly to produce stunning effects quickly. In future demos, we will be importing true 3d data from applications like Maya and Blender to further push the limits of what is possible.

blog comments powered by Disqus