• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Text on multiple size images

New Here ,
Aug 25, 2023 Aug 25, 2023

Copy link to clipboard

Copied

I am wanting to place text on several of my photographs that I have offered in my store. Each photo is offered in different sizes, such as 16x9, 32x18, 48x27 and 64x36. How do I place the text, which is relatively short, on these images and allow the text to essentially "grow" with each image? There may be an obvious answer to this that I am simply missing but I don't want to place text on my image that will be the same size throughout all the sizes. 

Thank you in advance for any help. 

TOPICS
Actions and scripting , macOS

Views

309

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Aug 25, 2023 Aug 25, 2023

Copy link to clipboard

Copied

You didn't tag this post with the action/script label, but I presume that you wish to automate this task to some degree.

 

A script could scale the text to the variable width of the document canvas, then scale the text to a final scale such as 20% of the width. This would deliver a variable but roughly consistent size for the same pixel dimension width documents if the text had the same number of characters.

 

What is the text content source? Is it manually typed in? Is it the filename? Is it from metadata such a the keyword?

 

Posting 2 or more sample images would help to illustrate.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 25, 2023 Aug 25, 2023

Copy link to clipboard

Copied

quote

You didn't tag this post with the action/script label, but I presume that you wish to automate this task to some degree.

By @Stephen_A_Marsh

 

I've edited to post to apply the Scripting tag.

 

Jane

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 28, 2023 Aug 28, 2023

Copy link to clipboard

Copied

try to add this script to photoshop, it will add a text layer with the size based in your actual file size (in this example i used 20% of the actual file size).
Remember to change "Your text" and the percentage "0.2"  in the script to what you need.

i hope it helps.

// Check if the Adobe Photoshop application is running
if (app && app.documents.length > 0) {
var currentDoc = app.activeDocument;
// Calculate the text size based on the current file's dimensions (change 0.2 to whatever % you want)
var textSize = Math.min(currentDoc.width, currentDoc.height) * 0.2;

// Create a new text layer
var textLayer = currentDoc.artLayers.add();
textLayer.kind = LayerKind.TEXT;

// Set text properties
var textContents = "Your text here";
var textColor = new SolidColor();
textColor.rgb.red = 255;
textColor.rgb.green = 255;
textColor.rgb.blue = 255;

// Configure text color, font, and size
var textItem = textLayer.textItem;
textItem.contents = textContents;
textItem.color = textColor;
textItem.size = textSize;
textItem.position = Array(currentDoc.width * 0.5, currentDoc.height * 0.5); // Center position

// Save the history
app.activeDocument.suspendHistory("Add Text", "null");
} else {
    alert("No documents open in Photoshop.");
    }

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 28, 2023 Aug 28, 2023

Copy link to clipboard

Copied

try to use this script, remember to change the values inside the script.
i recommend you to record a action to change position and color of the text after executing the script.

i hope it helps.

(please someone delete my other answer, i put the wrong script file. Thanks)

// Check if the Adobe Photoshop application is running
if (app && app.documents.length > 0) {
    var currentDoc = app.activeDocument;
    
    // Calculate the proportional text size based on the current file's width(change "0.2" to whatever percentage you want)
    var proportionalTextSize = currentDoc.width * 0.2;
    
    // Create a new text layer
    var textLayer = currentDoc.artLayers.add();
    textLayer.kind = LayerKind.TEXT;
    
    // Set text properties Change "Your text" to the text you want 
    var textContents = "Your Text";
    var textColor = new SolidColor();
    textColor.rgb.red = 0;
    textColor.rgb.green = 0;
    textColor.rgb.blue = 0;
    
    // Configure text color, font, and size
    var textItem = textLayer.textItem;
    textItem.contents = textContents;
    textItem.color = textColor;
    textItem.size = proportionalTextSize;
    textItem.position = Array(currentDoc.width * 0.5, currentDoc.height * 0.5); // Center position
    
    // Calculate the reduced text size (Change 0.2 to whatever % you want)
    var reducedTextSize = proportionalTextSize * 0.2;
    
    // Resize the text to the reduced size
    textItem.size = reducedTextSize;
    
    // Save the history
    app.activeDocument.suspendHistory("Add and Resize Text", "null");
} else {
    alert("No documents open in Photoshop.");
}


 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 28, 2023 Aug 28, 2023

Copy link to clipboard

Copied

it is going to add the text based in a percentage of the actual file size ( i used 20% for example)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 28, 2023 Aug 28, 2023

Copy link to clipboard

Copied

If your type is set in a physical unit, Points or Centimeters, you could put your text on the largest size print. You can then re-size for printing smaller sizes via Image > Image Size, with the Resample box un-checked. The text size will scale down along with the print, without changing the image itself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

LATEST

@Victoria Brader â€“ Did one of the scripts posted by @PedroMacro work for you?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines