|
|||
|
Hi,
I like to add borders to photos for which I have created few actions in photoshop. However for adding borders I have two options: 1. Add symmetric border (for e.g. 1" to all 4 sides) For e.g. Picasa Web Albums - Charansing - Kelsey Creek ... 2. Add border in percentage of height width to keep the aspect ratio For e.g. Picasa Web Albums - Charansing - NorthBend Trip I like the first option because having similar sized borders to all sides looks better. However, this changes my original aspect ratio of the photo. In second ratio since I use percentage method to add borders, the aspect ratio is maintained but if my photo's height and width are not same (like in 16:9) my borders are never of same size to all sides of the photo. So my question here is: How can I add border to photo (in photoshop or some other tool) so that I maintain the aspect ratio but still get same sized border to all sides? You suggestion on this is highly appreciated ![]() - Charan Picasa Web Albums - Charansing |
|
||||
|
OK, I'm a mathematician, so I'll probably screw this up. :P
What you want to do is crop the photo into a nonstandard aspect ratio, so that when you use Option #1 (same size borders on all sides), the resulting image DOES have the right ratio! Here's an example calculation. WARNING: Mathematical content ahead! Let's say you have an image which is 2000x3000 pixels (that's 2:3 = 4:6 aspect ratio). You want to end up with something in the same ratio. So, you'll have to trim some amount off of both sides -- say, remove x pixels from the 2000px side, and y pixels from the 3000px sides. Then, you'll add the same amount (say, b pixels) to each side for a border. Then: (2000-x+b)/(3000-y+b) = 2/3 This has many solutions (one equation with 2 variables and a constant, b), but we want the smallest positive values of x and y that make it work. So, first we get rid of the fractions: 3(2000-x+b) = 2(3200-y+b) Solving for y, we get: y = (1/2)*(3x-b) So, you need to pick x to be the smallest positive number which makes 3*x bigger than b. For example: If you have b = 300 (a border of 300 pixels), then y = (1/2)*(3x-300). So, x = 100 is the smallest that makes this work, and you get x = 100, y = 0. Then you can trim 100 from the 2000 pixel side, and 0 from the 3000 pixel side. When you add a 300px border, you'll have a 2200 x 3300 image, which is in the correct ratio. SUMMARY: For 2:3 ratio (most common on digital cameras), find the smallest value of x so that 3x-b is positive. Then crop x from the short edge, and y = (1/2)*(3x-b) from the long edge. Add a border of size b, and you're done. You can do something similar for other aspect ratios. Whew! I think I did it! :P
__________________
David Clark Photography, project 365 photo blog, flickr. It is OK to edit and repost my photos on the DPS forums only. |
|
|||
|
Not real sure if I understand what you are trying to do.. do you just want a line for a border around the outside of the image? If so,, you can use a stroke or you could add to the canvas size and make it however many pixels wide you like and whatever color you want. ie if you want a 10 pixel border, add 20 pixels to the width and height. DAve
|
|
||||
|
Quote:
Also, no clue about actions, sorry.
__________________
David Clark Photography, project 365 photo blog, flickr. It is OK to edit and repost my photos on the DPS forums only. |
|
||||
|
You could also always add a border INSIDE the image.
In the 3000x2000 with a 20px border example, you'd end up with an image that was the same size (ie 3000x2000) but you'd also have a 20px border on all sides. That means you'd end up losing 40 px per side, but that's not that much in the grand scheme of things.
__________________
I am responsible for what I say; not what you understand. OsmosisStudios Gear List |
|
||||
|
Quote:
__________________
David Clark Photography, project 365 photo blog, flickr. It is OK to edit and repost my photos on the DPS forums only. |
|
|||
|
Of course an even easier way would be to make square crops of the photos... bloody mathemeticians over-thinking again
!
__________________
"There can be few professions outside of artificial insemination and parachuting where equipment is as crucial as it is for a photohrapher"- Roy Mallard |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Each day we send out a quick email to thousands of DPS readers to notify them of updates. This email is just short excerpt of the first few lines of our latest post with a link if you want to read it all. You can unsubscribe from this this service at any time.
This service is provided by a third party (Feedburner) and you can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.
Enter your email address for
Daily Updates:
For those wanting a weekly summary of what happens on this site this free email newsletter is probably your best option. It includes a summary of the tips posted to the site each week. This newsletter is subscribed to by over 25000 readers (many who also subscribe to the other options above) - come join the community!
To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.
Enter your email address for
Free Weekly Newsletter: