How to import excel file to Photoshop (working with variables)
You may not know, but there’s a possibility to import data from excel file to Photoshop. The reason for that is to speed up the work, especially if you have to create a lot of images using a template, and the only thing you need to change is the text or images.
It would take you hours to do that manualy, but with variables, you can do this in a few minutes.
Of course, there’s a lot more you can do with variables in Photoshop.
What are the variables?
That are data driven graphics
“Varliables” give you an ability to take some kind o data like a text file or excel spreadsheet and actually merge that data and pair it up with a layer in a Photoshop document.
How to import data from excel to photoshop
The option “variables” not only help you to automatize adding text but is also a good solution if you have to import a lot of images to photoshop and save as various files. Follow steps below to import data to photoshop. Below the list you can find a detailed explanation of the steps with screenshots.
Here are quick steps:
- Prepare a template in Photoshop: Name the layers correctly (for example: “image” for the layer that contains images, “year” for the text layer where you will import different years from excel)
- Prepare images. Gather them in one folder, and name correctly (for example: “image1.jpg”, “image2.jpg”)
- Prepare an Excel file.
Remember to name the columns correctly, as the layers in Photoshop (“image” for the images column “year” for the text column that will contain years). Then, place in those columns proper data: for example, in the “image” column put names of your files: “image1.jp”, “image2.jpg”. - Save the excel file as .txt
- Define variables (options: Image -> variables -> define).
A new window will open. Pick layer “image”, and check the box “Pixel replacement”. Set name to “image”.
For text layers: pick the layer with text (for example “year”) and check the box “Text replacement”. Remember to set the name to “year”.
Repeat to all layers that you want to change. Click OK to save. - Import the .txt file to Photoshop. (options: Image -> variables -> data sets)
A new window will open. Click “Import” and select the .txt file. Click OK to save. - Export the Data Set. (options -> File -> Export -> Data Sets as Files)
A new window will open. Click button “Select folder” to choose to which folder you want to save your .psd files.
That’s all. If you have any problems, below you can find a detailed explanation to each step.
Importing data from Excel to Photoshop – explanation
1. Prepare a template in Photoshop:
Create your template and name the layers correctly. I always name the layers accordingly to data which will be imported to your template.
I have created a template in the style of album photos. The layer “image” will contains images,
The text layers:”year” is for the text layer where you will import data of different years from your excel file, and “Number” will obviously contain a number of the image.
I left the “Image copy” layer – it’s just a frame for “image” layer, I won’t import any images here.
Below you can see a screenshot of the template
2. Prepare Images
Gather all of your images you want to import to the template in one folder. I also rename them to “Image1”.
3. Prepare an Excel file.
Create columns – each column is for one layer. Name the columns the same as your layers in Photoshop: “images”, “year”, “number”. Important -> The size of the letters matters.
Place in each column proper data: in the “image” column put names of your image files: “image1.jpg”, “image2.jpg”, “image3.jpg”.
4. Saving CSV as txt
When I tried to save my csv file as .txt, i realized that Libre Office Calc doesn’t have such an option like Excel has – “export as txt”. So if you have the same problem, I gathered a few pieces of information on how to save .csv to txt
To save txt file in Libre Office Calc, you need to follow the steps below:
- Go to “File” -> “Save as”
- Pick the file type ” Text CSV (.csv)”
- Check the box “Edit filter settings”.
A new window will appear
- Change the “.csv” to “.txt”.
- Important -> As a plac to save your file, select the folder where you keep your images
- From the field delimiter drop-down select the {Tab} entry.
- Click OK.
Your file is saved.
Create .txt file on your own
If you don’t have Excel or LibreOffice Calc, you can create your .txt file on your own. Remember to use tab between the data. That’s how the txt file looks like:
5. Define variables
To define variables in Photoshop, go to options: Image -> variables -> define.
A new window will open.
Pick layer “image”, and check the box “Pixel replacement”. Set name to “image”.
For text layers: pick the layer with text (for example “year”) and check the box “Text replacement”. Remember to set the name to “year” accordingly.
*I omit the layer “image copy” since it’s just a frame and I won’t replace it.
Import the .txt file to Photoshop.
To Import file, go to options: Image -> variables -> data sets.
A new window will open.
Click “Import” and then click the button “Select file”. Select the .txt file. Click “OK” to save.
You can check your result by going to Variables ->Data Sets. Click an arrow icon next to “Data Set” box to see your template.
Important: If you have any problems with importing the file, please check if it’s located in the folder with the images. Also, check the size of letters of your variables – go back to step 5 (size matters).
Exporting Data Sets
You can export your data sets as .psd – all at one time. To do that, you have to follow the steps below:
Go to File option
Click the Export option
Select Data Sets as Files…
A new window will open.
Here you can select where you want to save the files, which data sets you want to save and rename your files.
You can also choose the compability (Windows, Mac OS or Unix)
How to export data set in Photoshop as jpeg
Unfortunately there’s no option for exporting the data sets directly to .jpg files. You can only export as .psd.
There’s already a topic requesting adding this feature here.
Thanks this is really useful. It was way easier to understand versus the Adobe tutorial. I have automated resizing with Photoshop but never used it to place text. This will be be really helpful for our Instagram account. 🙂
~ Geo