Hello,
First of all - thanks for the awesome community. My first post
I am trying to put my watermark on various images, normally the whole process is very simple and easy to execute, automate.
This time, differently, I need to add my watermark on images that are various in dimension. Some are 600*600, some are 900*900 and some 1500*800 etc etc.
I need to resize my watermark according to the size of the image I am applying it to. In other words, watermark needs to keep it's proportion relative to image.
For example, if I am applying watermark on a image with 1000*1000 dimension, watermark needs to be 100*100. If the next image is smaller, lets say 600*600 then watermark needs to shrink down to 60*60 to keep same proportion as previous image.
I did some research and found out it can be done with scripts but I am unable to code it myself and couldn't find any available to use either.
There is an awesome add-in for it Watermark CC but the function I need requires pro version which costs 30 dolars. Since it is a very situational exception, I can't afford to spend that money for one time use.
Any kind of help to set me on the right course is appreciated.
Watermark on Various Dimension
Re: Watermark on Various Dimension
Bonjour
In doubt about your script ....
I give you mine :
In doubt about your script ....
I give you mine :
Code: Select all
//NOM_Proportion.jsx
var docRef = activeDocument;
var docResolution = app.activeDocument.resolution;
app.activeDocument.resizeImage( undefined, undefined, 72, ResampleMethod.NONE);
var monNom = "txuku"; //mettre son nom
var Rouge = 230; //valeurs de 0 a 255
var Vert = 81;
var Bleu = 35;
valOpacite = 100; //de 0 a 100%
NomPolice = "CourierNewPS-BoldMT"; // "ArialMT" "LucidaCalligraphy-Italic" //"ParkAvenue BT" il faut trouver les noms postcripts des fontes.
var posHoriz = docRef.width*(75/100); //je donne un pourcentage de la taille du document
var posVertic = docRef.height*(98/100); //pour la position du texte
//Opacite = 85 ; // reglage de la transparence du calque texte ( de 0 a 100 )
var TailleFonte = "";
//Je rends TailleFonte proportionnel a la taille de l image :
TailleFonteW = docRef.width*(2/100); // modifier ( = 70 pt pour 3888 px - 20 pt pour 1000 px)
TailleFonteH = docRef.height*(2/100);
if ( docRef.width>docRef.height ) // Portrait ou paysage
{
TailleFonte = TailleFonteW;
}
else
{
TailleFonte = TailleFonteH;
}
var textColor = new SolidColor;
textColor.rgb.red = Rouge;
textColor.rgb.green = Vert;
textColor.rgb.blue = Bleu;
textColor.opacity = valOpacite;
//alert( TailleFonte )
//fontPostScriptName = "ArialMT"; //"LucidaCalligraphy-Italic"
//"ParkAvenueBT-Regular" - Normal Gras ...etc
//app.displayDialogs = DialogModes.NO;
//app.preferences.typeUnits = TypeUnits.POINTS;
var newTextLayer = docRef.artLayers.add(); // le calque de Texte
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.contents = monNom;
newTextLayer.textItem.position = Array(posHoriz, posVertic);
//newTextLayer.textItem.postScriptName = fontPostScriptName;
newTextLayer.textItem.font = NomPolice
newTextLayer.textItem.size = TailleFonte;
newTextLayer.textItem.color = textColor;
newTextLayer.opacity = valOpacite;;
docRef.flatten(); //aplatir
app.activeDocument.resizeImage( undefined, undefined, docResolution, ResampleMethod.NONE);
Re: Watermark on Various Dimension
thanks alot mate, most appreciated
-
- Posts: 1
- Joined: Mon Jul 01, 2019 4:16 am
Re: Watermark on Various Dimension
Hello all,
Can anybody help me do the same thing but the watermark here is an image?
Thank you so much!
Can anybody help me do the same thing but the watermark here is an image?
Thank you so much!
Re: Watermark on Various Dimension
Bonjour
You should open your own post !!!
In the Help Me forum
You should open your own post !!!
In the Help Me forum
Re: Watermark on Various Dimension
Great Post