Images And Text From CSV
Script for Adobe Photoshop
Latest update 6/16/2022, version 2.5
The script reads CSV spreadsheet data for image file names and text, searches a selected folder for the images, then merges each image with its text and saves an output file.
- Combine image and text for personalized images
- An easier way to accomplish data merge in Photoshop
- Process any number of images
Before using the script
Using the script requires some preparation.
First is a master image with a layer named “image”, and a text layer named “text”.
These two layers are the minimum required. There may be other layers or layer groups, a logo for example, or anything to include on all images output.
The second item to prepare is a spreadsheet of image file names and text, saved as Comma Separated Values (CSV format). The spreadsheet must have at least two columns, one for “image”, and another for “text”. The column heads must be precisely these values. Any columns with other labels, or columns beyond the two required, are ignored.
Rows of the column image are the image file names. The full path is not necessary, only the file name. In the script interface, the folder where images are located is selected, and its path is added to arrive at the actual location of each image.
Rows of the column text are the textual contents applied to the layer named “text” copied from the master image.
Example files are available to download, to try the script and better understand how it works before using it in actual production. See the download button below.
How to use the script
With the master image open, run the script.
The interface has three sections: Data file, Images folder, and Output. Select the data file, the images folder, and the output folder. Enable the desired options, and click the OK button to begin. If any problems occur, a log file is written in the output folder.
For each image processed, the layer named “image” is replaced by the input image, which is scaled to match the master image size, cropping as needed to maintain proportions. The text contents of the layer named “text” are replaced by the text in the spreadsheet data. The layer itself is not replaced, only the contents, to preserve any effects applied to the layer.
Section 1: Data file (CSV)
Delimiter — the character that separates columns of the data file. The default is comma, normal in the United States. Some European countries use semicolon rather than comma. Select the delimiter relevant to your region of the world.
File — select the CSV data file.
Section 2: Images folder
Folder — select the folder of images to process. Each image file name in the spreadsheet data that is found in this folder is processed.
Section 3: Output
Folder — select the location to which images are output.
Format — select the file format to output. Choices are JPG, PNG, PSD, or TIF.
Name — choose to use either the input image file name, or the text column to name output files.
Convert to profile — converts color to the selected profile prior to output. Note that PNG format is always converted to sRGB web standard, and the option to select otherwise is disabled.
TIP: Converting to another profile is primarily to make CMYK separations for print, which of course is functionality the script provides. But as well, this option can convert duotones to RGB or CMYK, or convert these and other color spaces to grayscale (use the profile Dot Gain 20%).
Flatten — result is a single “Background” layer. JPG always performs this step.
Quality — applies to JPEG images. Valid range is from 0 to 12. 0 is extreme compression resulting in low quality. 12 is light compression that is virtually indistinguishable from the original, the highest possible quality, which of course, results in the largest file size. 10 to 12 is recommended for print or other high-quality reproduction. For web images, 5 to 8 is an acceptable range.
Embed color profile — applies to JPEG images. Embeds into the JPG the current color profile, either for the original color space if not converted, or the profile selected for the Convert to profile option. The option exists for JPG so that files intended for print can include profiles, important to preserve in that case, but JPG for web may omit profiles, as the profile is excess and only increases file size.
PSD and TIF always embed profiles, and PNG never embeds profiles.
Save working file (PSD) — keeps an un-flattened version of the output file for later adjustment, if needed.
Folder — select the location to which working files are saved.
Images And Text From CSV
For help installing scripts, see How to Install and Use Scripts in Adobe Creative Cloud Applications.
Also available for hire to program custom solutions. Contact William for more information.
IMPORTANT: by downloading any of the scripts on this page you agree that the software is provided without any warranty, express or implied. USE AT YOUR OWN RISK. Always make backups of important data.