+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2012
    Adelaide, South Australia
    Thanked 0 Times in 0 Posts

    Creating a uniform border as a percentage of image size How?

    I am wanting to build a script that will allow me to add a black border measuring a uniform width (say 5% of the picture height) for a batch of images of different resolutions and sizes. Problem is, increasing the canvas size by +5% black on a rectangular photo will not produce a border of uniform width. It would also be great if I could add a name and logo (saved as an eps) to the border - something like the picture below. Can this be done as an automated script?
    Attached Thumbnails Attached Thumbnails Creating a uniform border as a percentage of image size  How?-border-textscript.jpg  

  2. #2
    Join Date
    Dec 2012
    Thanked 0 Times in 0 Posts

    Re: Creating a uniform border as a percentage of image size How?

    It is possible to write a script that does what you ask.
    On square photos ther's no problem, because 5% of the Width is the same as 5% of the Height.
    On rectangular photos, you need to take 5% of one of the dimentions, and add it to both width and height of the photo, IN PIXELS. For example, if you have a 100x60px photo (Tiny, I know) you calculate that 5% of 100px is 5px. Then you add 10px both to width and to height of the image (10px because you add 5px to left plus 5px to right, and same with up and down).
    If you have both portrait and landscape oriented photos, and you want the 5% to always be of the larger side, you need to check wether width>height. If it is, take 5% of width, else take 5% of height.

    Adding the EPS to the border is a bit more complicated, because the border is not the same (Width of border is resolution dependant).



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBulletin® Version 4.1.9
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.0
Copyright 2011 Photoshop Gurus Forum. All rights reserved.
All times are GMT -5. The time now is 10:13 AM.