Results 1 to 2 of 2
  1. #1
    Newbie Transformer's Avatar
    Join Date
    Nov 2012
    Adelaide, South Australia
    Post Thanks / Like
    0 Post(s)

    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
    Junior Member
    Join Date
    Dec 2012
    Post Thanks / Like
    0 Post(s)

    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
About Photoshop Gurus
Photoshop Gurus (PSG) is a friendly community of designers and artists who enjoy all things related to Photoshop. PSG can consider itself one of the oldest Photoshop sites and has recently had it's 10th anniversary. We've come a long way and have every intention to continue supporting the Photoshop community. Photoshop can be an overwhelming program for beginners and that's how we try to help. We have a friendly forum, tutorials and all resources to help you understand this wonderful program. Feel free to look around and if you have any questions, don't hesitate to ask. Happy browsing!