Mobile app version of vmapp.org
Login or Join
RJPawlick971

: How to create a batch job, numbering images (writing text on them) from 1 to 100 in Photoshop? Looking to create a 100 images that would have their appropriate numbers written on them. Since

@RJPawlick971

Posted in: #AdobePhotoshop #BatchProcessing

Looking to create a 100 images that would have their appropriate numbers written on them.

Since I`ll be most likely making changes to the template in the future I figured it would be better to automate it somehow.

Is there a simple solution to this problem?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @RJPawlick971

3 Comments

Sorted by latest first Latest Oldest Best

 

@Cugini998

Yes its possible to automate. Open Extend Script toolkit. Write
#target Photoshop
alert("Hello "+app.activeDocument.name+"!")


Save script and run it, it should now see a alert box provided that PS is open and has a document. Its just javascript you can find the reference manual:


PS scripting manual online.


Here is how you change text in a text layer and save it (adding the save bit because its a bit tricky):
#target Photoshop

var textlayer = app.activeDocument.layers.getByName('Text');
textlayer.textItem.contents = 'foo';

var exportOptionsSaveForWeb = new ExportOptionsSaveForWeb();
exportOptionsSaveForWeb.format = SaveDocumentType.PNG;

var saveFile = new File("file:///c:/temp/test.png");
app.activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, exportOptionsSaveForWeb);


So that i will not do all the work for you you still need to put a for loop around the code posted.

10% popularity Vote Up Vote Down


 

@Murray664

This is a solution for a problem described in Automate image creation with addition of number, that increases with each iteration

Yes, it's a bit similar, but instead of the current question witch is many -> many mine is one -> many and has a bit different and quicker solution.

Here it goes:


Opened an image, added Type layer with all the styling I wanted.
Then I went to

Image > Variables > Define…

Set Layer: to my text layer's name, set checkbox on Text Replacement and gave Text Replacement variable some Name: (I've named it number). And pressed OK.
Opened some spreadsheet editor like Excel, Numbers, Google Docs, etc… and entered the next stuff in the first column:


In first row I've written my variable's name (for me - number).
In the below (the 2nd row) I've entered 1. Sometimes for step 3 to work, you need to enter 2 in a 3rd row.
Now using standard spreadsheet autocomplete grab the lower right corner of a cell with 1 (or 2) in it and drag down. This way all the cells below should be filled with a sequent numbers (I've generated sequence up to 99).
Ok, all you need to do now is export your spreadsheet to CSV.

Now you should go to

Image > Variables > Data Sets…


select Import… browse your CSV file, and click OK. You can also check the Preview button to see how your image will look like with certain dataset (number). Once more click OK to save the Data Sets.
Finally, to get all the files with different stuff go to

File > Export > Data Sets as Files…


Select destination folder, and make sure you have All Data Sets option selected, as this will generate a file for each of out data sets, just what we need. In the same window you can also choose a naming option for exported files. And click OK :)
This will generate a psd files, so you'll need to convert them somehow into something simpler. This can be achieved with

File > Scripts > Image Processor…


This script will allow you to convert a lot of psd images into JPEG with one click of a button.


Also maybe you'll be interested in the next tutorial about Photoshop Variables: layersmagazine.com/photoshop-variables.html

10% popularity Vote Up Vote Down


 

@Tiffany317

It depends how you define "simple." Photoshop has variable data functionality built in, but it's not terribly well documented and is considered an inappropriate subject for polite conversation, such as at cocktail parties or church socials. On the other hand, it's years since I used this myself, so constructing this tutorial has been a good refresher.

You'll need a comma- or tab-delimited file with a name for each variable (I'm going to use "Image" and "ImageNumber"). Here's the one I mocked for this exercise. Note that the image filenames have no path only because they are in the same folder as the data file. You can use relative or absolute paths for the filenames:



You need to set up your template. Lets assume that you need two layers: the image (variable) and the number (a text layer, variable). The image layer must be an actual layer, not the background.



Once you have these set up, select the image layer, and under Image > Variables > Define you will get this dialog (I checked the "Pixel Replacement" checkbox, since that's what we need to use):



Change the "Name" field to your chosen variable name ("Image") and set the "Method" to what you need. I'm choosing "Fill," which will resize the image proportionally, but you may prefer something else. Information about each method shows in the Description field when you hover on the name. Close the dialog.

We select the text layer and repeat the process, naming the text variable "ImageNumber."



Now we have to define a Data Set, so click the "Next" button in the dialog and click the New Data Set icon (right by the trash can) in the dialog.



A Data Set is a collection of values that apply to a particular output document, not a complete set of values in a comma-delimited file, so now we define a starting image for our template by clicking the "Select File..." with the Image variable selected. I chose the Chrysanthemum image. Be sure that "Do Not Replace" is NOT selected.



Now we have to import the data sets from our comma-delimited file using the "Import" dialog.



Exhausted yet? -- There's more. Click OK to close the Variables dialog.

The final step is to choose File > Export > Data Sets as Files... and choose a place to save the output, along with your choice of naming convention.



When you click OK, the entire set of psd file will be exported to your chosen location.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme