Create a uniform percentage of the size of the image border. How?

I am wanting to create a script that will allow me to add a black border measuring a uniform width (or 5% of the height of the image) for a batch of images of different resolutions and sizes. Problem, increase the canvas size of 5% of black on a rectangular picture will not produce a uniform width border. Also, it would be great if I could add text + logo (recorded earnings per share) at the border – something like the image below. Is this possible as an automated script?

Border&TextScript.jpg

Please try this version, it uses the smaller side to get the 5%...

if(documents.length) app.activeDocument.suspendHistory('Add Border', 'main()');
function main(){
var startRulerUnits = preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var doc = activeDocument;
var fivePercent = (Math.min(doc.height,doc.width)/100) * 5;
var OffsetX = fivePercent;
var OffsetY = fivePercent/4;
var Black = new SolidColor();
Black.rgb.hexValue = '000000';
var White = new SolidColor();
White.rgb.hexValue = 'ffffff';
app.backgroundColor=Black;
doc.flatten();
doc.resizeCanvas((doc.width + (fivePercent*2)), (doc.height + (fivePercent*2)), AnchorPosition.MIDDLECENTER);
var newTextLayer = activeDocument.artLayers.add();
newTextLayer.kind = LayerKind.TEXT;
newTextLayer.textItem.kind = TextType.POINTTEXT
newTextLayer.textItem.color = White;
newTextLayer.textItem.font = "Georgia";
newTextLayer.textItem.size = 14;
newTextLayer.textItem.contents = "PMR Photography";
var LB = doc.activeLayer.bounds;
var LHeight = Math.abs(LB[3].value) - Math.abs(LB[1].value);
var percentage = ((fivePercent/LHeight)*50);
doc.activeLayer.resize(percentage,percentage,AnchorPosition.MIDDLECENTER);
LB = doc.activeLayer.bounds;
var X = (activeDocument.width - fivePercent) - LB[2].value;
var Y = (activeDocument.height - OffsetY) - LB[3];
doc.activeLayer.translate(X,Y);
doc.flatten();
preferences.rulerUnits = startRulerUnits;
}

Tags: Photoshop

Similar Questions

  • How to create a Viewer without buying the image? I want to be able to save the images I'm looking a subject without purchase or download.

    How to create a Viewer without buying the image? I want to be able to save the images I'm looking a subject without purchase or download.

    After talking to the Customer Service, I now get it. Thank you.

    That is to say: down arrow recorded a watermark image in the gallery without you buy. You can download an overview lores on your desktop for motorhomes with this same arrow, but it is unfortunately a watermark (unlike the DPC). You can also copy and send a link to the Gallery clients to review before you buy.

  • Imports to create my destination but put the images in a subfolder under my destination (always under the same name but different from my folder created)

    Imports to create my destination but put the images in a subfolder under my destination (always the same name but different from my folder created under) Lightroom CC 2015.3

    I solved the problem. I think that this should be addressed.

    When importing from is no possibility for "put it in a subfolder when.

    display all the options. But there is down to bottom left a little box that

    When hovered says 'show fewer options'. When this window opens and copy

    is selected, it offers the possibility to in a subfolder. Who has been

    selected and the origin of the problem.

    It is an option that should show the full screen, but also the show

    under the screen.

    Monroe

    Monroe Halpern

    [email protected]

  • I have a virus inches in my file and I lost all my files from the image. How can I get them back?

    I have a virus inches in my file and I lost all my files from the image. How can I get them back? Folder was on the desk. So please help me. All files were very important for me. Thank you.

    I have a virus inches in my file and I lost all my files from the image. How can I get them back? Folder was on the desk. So please help me. All files were very important for me. Thank you.

    =====================================
    Are you running Windows XP?

    Please post more details. The more information you share
    you chances of a solution.

    How do you know it was a virus?

    The virus has been removed?

    When the problem happened everything first?

    "Was" folder on the desktop? You say all
    folder is missing?

    The file might be in the trash?

    Is it possible that your files are still there but have
    become hidden?

    Reach... Control Panel / folder Options / View tab.
    ... To check "Show the hidden files and folders" / apply / OK.

    If the photo thumbs reappear... they can turn washed
    outside. To clear this up... right click a thumbnail or a
    selected (highlighted) group or folder and the
    menu... Choose... Properties, uncheck the box.
    'Hidden' / apply / OK.

  • in the folder windows images, photo icons are the same and are not actually see a little image of the image. How to make this happen

    in the folder windows images, photo icons are the same and are not actually see a little image of the image. How to make this happen

    Hi tonutot,

    1 when was the last time it was working fine?

    2. did you of recent changes on the computer?

    3. only happens in the pictures folder?

    Check and make sure that the bottom of settings is set correctly on the computer.

    (a) in the currently open folder, click organize on the toolbar, and then click folder and Search Options.

    (b) click on the view tab, and then deselect the always show icons, never thumbnails check box.

    (c) click on apply and OK

    Behavior and change folder views

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-folder-views-and-behavior

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I paid for a pic but watermark adobe still appears on the image. How can I remove it

    I paid for a pic but watermark adobe still appears on the image. How can I remove it

    Hello

    Please see the thread below for help:

    Watermark removal

  • I just bought two images, but there are so many link or anywhere for me to download the images. How can I download these?

    I just bought two images, but there are so many link or anywhere for me to download the images. How can I download these?

    Just follow these steps: I downloaded my 10 free images and they all have the Adobe watermark on them, so I can't use them. Why do they have a watermark on them?

  • Create droplets to batch convert the image of 4000x4000px in 300 DPI / 72 dpi 1000x1000px / 500x500px by 72 dpi

    First time posting here and salute to all the gurus,

    I created a droplet to convert batch of images to ' 4000x4000px by cmyk 300 DPI jpeg / 72 dpi rgb jpeg 1000x1000px / 500x500px by 72 dpi rgb png "and record in the respective folders, but was met with some problems where the drop is not convert images to the planned size 1000x1000px jpeg 72 dpi."»

    The list of my actions are as below.

    Screen Shot 2015-07-18 at 02.01.39.png

    This is when I ran the drop, the resulting image was still at 300 dpi, although the pixel dimensions changed 1000 x 1000. Could someone show me where I so bad?

    To tell the truth-Actions have as hard time saving file where you want to with the names you want. Lot can help because it can override save as ad defined stages the destination.  You never said what version of Photoshop you use.  IMO, you'd be better off forgetting about creating an action to create a droplet or using Photoshop batch.  What you try to do is better with Photoshop scripts.  In this case, failed to write the Script.  You should find script Image Processor Pro plug-ins and download it and to use the process you images.  You can customize simple action that you create. In fact, a different action can be used for each file that you want to copy. Script options allow you to control where the files are rolls to and has many options of naming. The Script can also resize your image to fit the size you need.  Each output process of file with a copy of your image. For each output process is independent does not necessarily concern himself with other processes of output file. Each process is distinct from the others.  The dialog Script is flexible and you can add custom tabs to create output files.  Because the computer has plugin you can even save its use in actions.  The action will have all the setting that you used in the recorded in the action scripts dialog box and when the action is played no dialog box will be displayed. The saved settings will be used.

  • percentage of the images inside InDesign scaling

    Hello

    got a picture with a size of 544 x 408 px meassured in photoshop.

    Sure as layers .psd to 264dpi.

    Bring it in InDesign where I create articles for a folio of 1024 x 768 px.

    At 100% the size of the image 101.489 x 96.233 px.

    It's a question of resolution, but if so it means pixels in photoshop are not equal to pixels in InDesign?

    Please, anyone who can explain this to me?

    Thanks in advance,

    Herman

    This is probably a question to understand the effective difference between 'Actual PPI' and "PPI." To see the difference, select your placed image and display the Info Panel (window > info). Then put the image to enlarge. As long as your Effective PPI is greater than 144, you have nothing to fear.

    Exception: If you create image for overlays files as sequences of images, use save for Web to create images to 72 dpi.

  • To create a ToolTip text for the image with multiple image map links

    Hello

    RH6 using, that I imported a picture into a topic. For the images that I have created several maps image to post a link to other topics. However, I can't create a map image additional to that same image that includes only the screen Tip text. I get a message of invalid value: "Please select a file, bookmark or topic to bind the hyperlink to.»

    Is there a way to create a popup only the text of an image with multiple image map links? My final output will be to WebHelp but possibly migrate FlashHelp in the near future.

    Thank you

    FMnRH



    Thank you
    FMnRH

    If the image is at the beginning of the subject, or all alone in a reference topic, you can put "#" (without the quotes) as the link for each area reactive.

    If the image is larger than the viewing window, it can jump to the top, but only if the user clicks on the link.

    I tried wz_tooltips and like it. I agree with Leon, it will take time for the first image but maybe go faster later.

    Harvey

  • An excerpt from CAN (can edit, change, etc.) created from a trace of the image paths? (CS6)

    Hiya Adobe community,

    This might me up a little, but a long time ago I used to use Freehand as my defacto design tool until I went to I. At that time, I also used "Rationalize" (http://www.adobe.com/products/streamline/) to perform the functions track image is today. While its results were a little rough, the software gave me the vector points, paths and acnhors that I needed. After all the traces, I could manually change the vector traces resulting.

    I have been using the CS6 tracing feature, but the only thing I can't understand for the life of me is the question of the "bounding box" for an imported picture. Whenever I have draw a drawing, tracing of AI results always placed a bounding box around the area of the vectorized image. My goal: to locate an item, get rid of the bounding box and extract contours and paths so that I can then change to my link.

    Is this possible? Im sure it is possible... I can not find how. (Or I do the wishes of crack?) Everything I have said, if Streamline allowed me to change the track paths, so it would be a shame if AI CS6 is not.

    See the image attached for some content. Thanks in advance for any help!

    Screen-Shot.jpg

    Select your tracing and go to the Image Trace > Expand

    You may also then dissociate

  • I have pictures of underground anomalies reflection profiles, I want to put a measure of scale along to the and the side of the image. How I do that in a picture?

    I'm thinking GPR profiles which must have the scale placed along the top and side of the image borders.  I need to crop the image, given that the existing software has its own scale that I can't use.  I need to place the image on a neutral background cultivated have space to add text, such as the direction of the movement, magnetic north, information. Im going to try to * a copy of the image that I have for example.  Although I want to learn how photoshop works I need to get this out of the way.  You will also need to understand how to assemble the images since some reflection profiles are longer than what can show the soft ware GPR.

    CRC Day 2 pipe Calibration.jpg

    I would create a shape layer that contains your ranges. I make a separate scale for each side and have the scale longer that you need so you can use it with different images. Before you crop or resize, I bring in leaders and their reference of scale scale that you ever image before cropping. Then put the scales in a dynamic object and the harvest, ensuring that you remove cropped audited pixels. This will be crop your original image, but areas of scales that fall outside the area of culture will not be deleted, because they are in Society. Once crop you, if the image is a background image, change it to a normal layer by clicking on the lock icon in the layer panel. Now you can use the size of the canvas to add the amount of the borders you want around your image. You can create a United below your main image fill adjustment layer and choose what color you want the background to be. Then, you can move your scales where they should be. Use a mask for the scales if they are too long. Most of this can be implemented in action so that you don't have to manually do each step. The scales are fairly easy to do using the line shape tool. Just create a single line and duplicate many times you need divisions in your balance. One of the fixed lines at the beginning of the scale and the other at the end of the scale and select the layer with the line and use the distribution with the move tool function to space out the lines. Transform a part of the major subdivision to longer lines and add text. Here is an example of a scale, I did for my work:

  • I have a HUD following my cursor with info on the image. How can I get rid of him?

    One of my Mac Pro, there's a HUD display with information about the image. It sticks to my cursor, and making it difficult to work. I'm sure there must be a command to stop this, but I'm not. I have another Mac Pro at work, and he does not. Any help would be appreciated.

    It's probably the Tooltip Metadata.

    You switch on and off with the key combination command-T or the browser and menu overlay metadata visualization:

  • I upgraded to IE 9, now I can't see all the images. How can I fix it

    I can't see all the images on the sites Web or on explore all I have is the script.

    Try this

    http://Windows.Microsoft.com/en-us/Windows-Vista/why-cant-I-see-the-pictures-on-a-website

    http://www.slipstick.com/problems/redx.asp

  • My 6 screed work items suddenly disappeared to blue while he was working on the image. How can I return to the screen by default?

    the screen of my work disappeared suddenly blue while he was working on an image. How can I go back to the standard work (default?) screen

    litztombo wrote:

    the screen of my work disappeared suddenly blue while he was working on an image. How can I go back to the standard work (default?) screen

    "Blue screen" looks like this:

    blue screen of death

    Everything you need to know about the Blue Screen of Death

Maybe you are looking for

  • Some Web sites are not accessible because it automatically redirects me to google + 1 thing

    This morning in particular trying to access www.swgemu.com will do but a lot of good site do the same. Unable to read these Web site...

  • Problem recognizing face Chicony USB 2.0 Camera

    Hello I've just set up my facial recognition on my Toshiba laptop, but the room where I was in in time was dark, so I changed the web cam settings to activate the night mode. But now when I log on to the laptop and start face recognition, that web ca

  • Skype is not responding

    Skype stopped responding whenever I try to call someone, or to join a group call. This problem has occurred while I was in a call with a friend, and it has just stopped responding out of nowhere. It also crashed when I tried to change my camera setti

  • Question about 64 bit Toshiba processors

    Can I get a list of Toshiba laptops that have 64-bit processors and 32-bit?

  • Group Policy in windows 7 64 bit

    Hello I hope someone can will be able to advise with a problem I encounter. In our company run us Windows 7 64 bit under group policy. We do not allow users to be able to download content from the internet, but there is a problem where, in group poli