Click on any phrase to play the video from that point.
[♪♪] [ADOBE TV Presents]
[♪♪]
[The Complete Picture with Julieanne Kost]
[♪♪] Hi and welcome. My name is Julieanne Kost.
On this episode of The Complete Picture
we're going to talk about a little known but extremely powerful feature in Photoshop,
and that feature is called Variables.
Now, you might have heard it called Data-Driven Graphics in the past,
but Variables is what we're going to refer to it today.
And what they are is they're the ability to take some kind of data
like a text file or an Excel spreadsheet
and actually merge that data and pair it up with a layer in a Photoshop document.
So this might be extremely useful, for example,
if you've just photographed an event.
And each time you photographed a couple, you entered into the database
or your Excel spreadsheet or whatever--your text file--the name of the couple.
Now you've returned to your studio, and you've got this great template
that maybe has your logo on it or has a cool background or design.
You want to put the photograph and you want to merge the photograph
with the name in that text file.
So let's take a look at how we're going to do this.
This is a little bit different example.
What I've got is I want to make a set of images that have a photograph in it.
In this case it's a photograph that I took out the window of a plane.
I want to add the route or the flight that I was on,
and I want to add the year that the photograph was taken.
So I've actually got four layers here in my Layers panel.
We're going to turn 3 of them into variables.
We're going to turn the photo layer into a pixel replacement variable.
We're going to turn the year text layer into a text replacement
as well as the route.
So let's take a look at the spreadsheet here.
So we're going to jump over to Excel because I just want to show you
what it is I'm planning on doing.
I basically have 3 columns here.
I have my photo column.
This has the name of each one of the photographs.
I have the route, so that's going to be the flight that I was on.
And I have the year that the image was taken in.
If we go to the Finder, you will also notice that I'm containing all of this content
in a single folder.
So we've got all of the JPEG files here, all of the pictures,
plus I've got my Photoshop template
and I've got this Excel spreadsheet.
You can't actually use the Excel spreadsheet.
What you have to do is you have to just save this as a text or a tab delimited file.
That's as easy as going to File and then Save As
and then choosing right here from the Format this Tab Delimited Text,
this .txt file.
And in fact, if we wanted to see what that looks like,
we can go ahead and open this up.
I've already done it, and you can see that I still have my 3 columns.
They're just separated by a tab.
And then we've got the list of the images, all of the routes, and all of the years.
Again, it's now a tab delimited spreadsheet--
or not really a spreadsheet but a text file.
This is actually the text file that we're going to use in just a minute.
Why I wanted to show you this was just sort of so you could get an overview
but also to take note because this is really important;
it won't work unless you do this.
When we set up the variable in Photoshop,
you have to make sure that the column names are named exactly the same
as the variable that we set up
and even to the point where you can't have one capitalized and the other one in lowercase.
It won't work. They have to be exactly the same.
So all we need to do is go to the Image menu,
come down here to Variables, and define our variables.
You can see here in the Variables dialog box
that we can look and access all of our different layers.
I'm going to start with the photo layer.
What I want to do is I want to do a pixel replacement
and I want to be sure that the name of the variable
is the exact same as the name of that column. So we'll call it Photo.
You can see I'm very simple, so for me I just name the variable the same as the layer,
the same as the column name. It just makes my life easier.
I have a few different options here as far as fitting my image into my template.
Do I want to fit it, fill it, leave it as is, or conform it?
Well, I already ran an action that simply makes all of my images the correct size,
so I don't have to worry, really, about any cropping or whether or not it's going to fit
because I know that that photo layer is the exact same layer as all of my photographs.
So we can just hit Fit. All right.
Let's define our other two layers.
We skip over the edges because the edges are going to appear in every single image.
We go to the year, this time I add a text replacement,
and we will call this Year.
And finally, we go up to route, text replacement again,
and we call this Route.
And you'll notice that all of the layers that actually have been turned into variables
have the little asterisk after them.
Okay. So at this point I could click OK.
In fact, let's go ahead and do that. I'll click OK.
And then I need to actually go grab that spreadsheet or that text file.
So we go into the Image menu, come down to Variables again, and go to Data Set.
I didn't really have to do that because, look, right up here you can toggle back and forth
between defining your variables and moving right to your data sets,
but I just wanted to reinforce that this whole dialog box is underneath the Image menu.
Okay.
Certainly I could go in here and enter in my own data sets,
but what a hassle when I happen to have that text file that we just need to import.
So I'll click Import.
We're going to go select our file.
In this case I will go and navigate to my Variable folder
where all of the photos and the template--
the Excel spreadsheet is there but, see, it doesn't let me grab that one.
It has to be that tab delimited text file.
And you don't have to start in Excel.
You could just enter this in simple text.
Just make sure between each variable, like, for example,
between the photo name and the route and the year, you have a tab.
That's why they are tab delimited text files.
Okay, so let's open up this text file.
Encoding: Automatic.
I'm not going to use the first column for my data set names,
and I'm not going to replace anything because I haven't set this up before.
So we'll just click OK, and let's turn on our preview.
When I do this and we move our variables out of the way here--our dialog box--
you can see that I can move through each one of my data sets,
and as I do this, Photoshop will go ahead and actually load all of the variables.
So you can see it's changing out the photo layer, the route, and the year
and plugging them in to the template.
So this is exactly what I want.
I only had a few images, but you can imagine. What if you had 500 images?
You certainly wouldn't want to be doing this by hand.
This is the perfect way to merge some kind of text or photos together
and a template in Photoshop.
Okay, so when you're done here,
you're going to click OK, and it's all going to look like it disappeared.
But don't worry.
You've set up the variables, you've imported the data.
All you need to do now is go to File, Export,
and export your data sets as files.
So let's go ahead and select a folder.
We'll just go to our desktop here,
and we'll create a new folder, and I'll just call it Data Sets.
We'll hit Create, we'll choose that folder,
and then we can do all sorts of document renaming.
I'll leave that up to you as far as how you want to name your files.
I'm going to save this out as a PSD file,
and I want all of my data sets.
You can just selectively--like, for example, if you were going to test something,
you might just want to pick one of your data sets.
But we'll do all of them, and we'll go ahead and click OK,
and Photoshop will actually go ahead and create all of those files for you, just like that.
So while it's creating these, I just want to mention three things again
that are super important just to reinforce them.
One, the variables cannot begin with an illegal character,
so don't name anything in your spreadsheet or your Variables dialog box
with a question mark or with a backslash or with any of those things.
Just keep it very, very simple.
Again, the images have to be in the same folder as the template or it won't be able to find them.
And the variable name has to match the name of the variable column in your text file.
Okay, so now all we need to do is just scoot over here to the Finder.
We'll go to the desktop, we'll go to our data sets, and, in fact, here we can see
all of those data sets have already been created for us.
In fact, if we want to go ahead and open this up, we can.
And you can see that we've got the photograph, the route,
and the year already put into the file for us.
Excellent. That wraps up this episode of The Complete Picture.
My name is Julieanne Kost.
Thank you so much for joining me, and I hope to see you again next time.
[♪♪]
[Executive Producer - Bob Donlon] [Producer - Karl Miller]
[Director - Kush Amerasinghe] [Post-Production - Erik Espera]
[ADOBE TV PRODUCTIONS] [♪♪]
