Variable Data…Yawn?.

Recently I decided to create a project in Adobe Muse for a young girl whose favorite plush toy is “Rhino”. A simple site which started as a basic slide slow but developed into a personalized learning tool with the appearance of random words for her to learn.

Adobe Muse has the ability to generate slideshows and play the images randomly via a shuffle function but I needed a way to generate a new word at the click of a button. The button would reload the page and because shuffle was activated there was a good chance the word would be different and appear random.

So now I needed a way of creating several images (the more the better – for random appearance). Thats where Photoshop, Variable Data and a spreadsheet comes in.

Heres how.

1. Create a base image.
In this case the base image is the scene with a blank area for the words to appear. The Text layer is used to make sure the font size will fit the space. Its content is not important at this stage.

rhino_base

The text layer will become the variable – the thing that will change.

2a. Create a spreadsheet..
Create a spreadsheet that will contain the data to be replaced. In this case its a simple list of words. I built separate files for words of 3,4,5 and 6 letters as each of them had a different base image. Save the spreadsheet as a .csv file.
2b. Define the Variable.
From the Photoshop menu, Image > Variables > Define… From the Layer drop down menu select the text layer. Then choose the type of variable. In this case it is a text replacement. Enter the name of the column header from the spreadsheet exactly. In this example I have also defined the Layer fileName as a variable but left it hidden.

rhino_variable2

3. Import the Data Set.
Image > Variables > Data Sets… Select the Import button and navigate to the .csv file containing the list of words. Make sure to the check the option for “Use First Column For Data Set Names”. This will allow us to use the data in the first column in the file name later.

rhino_variable3

4. Export the files.
File > Export > Data Sets as Files… Here we can set the location of the files and the name. Note that I have selected “Data Set Name” as the second part of the file name. This will be drawn from the first column on the spreadsheet because we set the variable in step 2b. (hidden layer)
I have also hidden the background layer because the only aspect of the resulting files I am interested in is the changing data (words)

rhino_variable4

The result is a bunch of PSD files which each still contain all the hidden layers that match the dimensions of the base image. As most of the file is transparent, they are lightweight and should load quickly. Their same pixel dimensions makes it easy to overlay them on the base jpg image.

rhino_variable5

If you need a different file format, as I did (PNG) then Bridge can help you via a batch action or Image Processor. From the menu select, Tools > Photoshop…

If you really want to see the result in action, bear in mind I may be experimenting with it from time to time but Phone, Tablet, and Desktop versions can be found here:

rhinoWords_small

Using Variables I was able to generate 177 separate images in minutes, after initial setup. The longest time was the development of the spreadsheets. Adding additional words to the site would be a simple case of adding them to the spreadsheet and running the Export again.

Variables can also be used to switch out images to generate banner ads, business cards, ID cards, etc.

One Response to Variable Data…Yawn?.
  1. […] to my previous post which resulted in multiple files of the type I didn’t require, I needed a way ... lightroomtampabay.com/2015/03/batch-processing-for-png