RetouchPRO

Go Back   RetouchPRO > Tools > Software
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Software Photoshop, Lightroom, Paintshop Pro, Painter, etc., and all their various plugins. Of course, you can also discuss all other programs, as well.

How to Select an Exact Width from an Edge?

Reply
 
Thread Tools
  #11  
Old 09-29-2011, 11:21 PM
John Wheeler's Avatar
John Wheeler John Wheeler is offline
Senior Member
 
Join Date: May 2011
Location: Colorado
Posts: 583
Re: How to Select an Exact Width from an Edge?

Hi Robert

I posted this here and also on NAPP where you also asked the question.

Thanks for the clarification and I think I have a way to do this that will work in an action at any ppi, any image size, and any wood frame size. The action does not allow any arbitrary fill. This action steps below will fill one edge with the mirror of the base image along that edge. You would have to create other actions to put in something else yet this should give you an idea of how to do this. This specific action will be to create that mirror edge on the top side of the image

- Make sure original image is not a background layer
- Create duplicate image and move to bottom layer and make this layer active
- Image > Canvas Size; check relative; X.X inches height; anchor point at bottom (this creates X.X inches of transparent edge at the top) NOTE: you can make this step a manual step to put in whatever you want or create sets of actions with various sizes.
- Transform > Scale the duplicate image with anchor point at the top and Vertical Scale set to minus 100% (-100%). This mirrors the duplicate image into the transparent area underneath the original image.

That is the end of the sequence for one edge.

If you want to continue with other edges, go back to the original image, duplicate it and move it under the original and then follow this same procedure yet focusing on other edges. If you do all four edges you are left with transparency in the four corners per your request to fill those in later. An easy modification could be used to have those filled with the already mirrored tops or sides.

Here is an example result after doing all four sides. The original image was 10 inches wide by 5 inches tall and the wrap was set to 1.5 inches per edge. Hope this is useful

1365157_32709715-screenshot.jpg

Image complements of Stock Exchange: http://www.sxc.hu/photo/1365157
Reply With Quote top
  #12  
Old 09-30-2011, 03:02 AM
Chain's Avatar
Chain Chain is offline
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 551
Re: How to Select an Exact Width from an Edge?

RobertAsh:
Now that you provieded the steps you wanted it is clear that it's better to change the whole procedure rather than work out a good way of selecting 1,5 inches. The better way is to first (with your image as a layer) expand the canvas, then transform(flip) copies of the image into the newly expaned canvas – this is what John suggests as well. No selections required, and it is size independent.

I have attached an action that does this – including filling the corners. It will stop to ask you what size you want to expand the image by (5 inches width and height is default; set it to whatever).
I made one version that saves each side/corner as a separate layer (for you to study), and one that creates them as a merged layer. At the end, the action crops the image to remove the information outside the canvas.

Chillin: As you probably missed in my first post, "transform selection" does NOT work for this as it saves in the action using % (even if you typed in inches). So if you try it on an image that has a different size it will no longer be 2,5 in.
Attached Files
File Type: zip Expand edge.atn.zip (1.5 KB, 10 views)

Last edited by Chain; 09-30-2011 at 05:08 AM. Reason: Rewrote a couple of sentences for clarity.
Reply With Quote top
  #13  
Old 09-30-2011, 05:29 AM
chillin's Avatar
chillin chillin is offline
Senior Member
 
Join Date: Sep 2006
Location: The Golden State
Posts: 1,324
Blog Entries: 1
Re: How to Select an Exact Width from an Edge?

Quote:
Originally Posted by Chain View Post
RobertAsh:
Chillin: As you probably missed in my first post, "transform selection" does NOT work for this as it saves in the action using % (even if you typed in inches). So if you try it on an image that has a different size it will no longer be 2,5 in.
Yes, I did. Thanks

Excellent work Chain, your action works great.

Last edited by chillin; 09-30-2011 at 09:51 AM.
Reply With Quote top
  #14  
Old 10-01-2011, 06:14 AM
RobertAsh RobertAsh is offline
Senior Member
Patron
 
Join Date: May 2011
Location: Oakland, CA area
Posts: 380
Re: How to Select an Exact Width from an Edge?

John, Chain, Chillin,

Thanks. Much appreciated. I walked through John's steps manually and this approach is very clever For the image I was working on unfortunately I included a couple of pixels of extra white space when I cropped it. So for that specific image I can't get a clean seamless fit. But avoiding doing that in the first place is a question/topic for a separate thread.

I'll try Chain's action this morning, am working on a few images right now that require doing this and let everyone know how it worked.
Reply With Quote top
  #15  
Old 10-01-2011, 10:59 AM
John Wheeler's Avatar
John Wheeler John Wheeler is offline
Senior Member
 
Join Date: May 2011
Location: Colorado
Posts: 583
Re: How to Select an Exact Width from an Edge?

Hi Robert

It will be good to hear how it comes out. Leveraging the image in my other post, the corners can be filled a couple ways.

- Do the top and bottom edges first (or left and right edges), create a stamp of that and then use the same mirror procedure except using the stamped version to fill in the left and right edges (top and bottom edges) respectively. That would fill in the corners

- Another approach would be to create a selection of the 4 transparent corners, expand the selection several pixels, and then do a content aware fill. That is what I did with the image below (leveraging from previous post). I also added a one pixel wide line where the original image was located. The CAF did not do a bad job in this case especially considering it is for the wrap corners IMHO.

http://i774.photobucket.com/albums/y...Fincorners.jpg

CAF-using-SWF.jpg
Reply With Quote top
  #16  
Old 10-01-2011, 12:46 PM
RobertAsh RobertAsh is offline
Senior Member
Patron
 
Join Date: May 2011
Location: Oakland, CA area
Posts: 380
Re: How to Select an Exact Width from an Edge?

Hi John,

Another great idea. CAF should do fine in most cases given the corners will be folded in on themselves anyway. Where CAF doesn't work I can re-do the corner by hand.
Reply With Quote top
  #17  
Old 10-01-2011, 06:46 PM
Chain's Avatar
Chain Chain is offline
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 551
Re: How to Select an Exact Width from an Edge?

I can understand using CAF when doing it by hand, but in an action I imagine just flipping the image into the corners will be quicker. Either way the result should be fine since - as you say - the corners will be folded in on themselves anyway.
Reply With Quote top
  #18  
Old 10-01-2011, 07:22 PM
chillin's Avatar
chillin chillin is offline
Senior Member
 
Join Date: Sep 2006
Location: The Golden State
Posts: 1,324
Blog Entries: 1
Re: How to Select an Exact Width from an Edge?

I have used both of Chain's actions & it made me think about efficiency.
It is nothing wrong with them, they are perfect for very good computers, but my isn't so good & I looked for ways to speed it up a little. I used a pic: 600 resolution (pix/inch), 20" by 25.37" , 12000x15222 pixels 14mb.
The Chain's method 1 took 9 minutes & 44 seconds to complete (including flattening the layers.) Method 2 took 31 minutes & 14 seconds.
Every time I purged memory & history to give my old computer a chance.
I came out with a third method that took 3 minutes & 25 seconds.
Great challenge. Thanks Chain.
Attached Files
File Type: zip Edge_fast.zip (1,014 Bytes, 9 views)

Last edited by chillin; 10-01-2011 at 08:20 PM.
Reply With Quote top
  #19  
Old 10-02-2011, 05:54 AM
Chain's Avatar
Chain Chain is offline
Senior Member
 
Join Date: May 2009
Location: Oslo, Norway
Posts: 551
Re: How to Select an Exact Width from an Edge?

Whoa, that sure is a high resolution image you've got yourself there!

When I made the straight-forwards actions I ran them on a low-resolution image, on a 4 year old Mac Pro with 8 GB RAM, so didn't notice the performance issue. I'm surprised it took that long to run; what is your processor and RAM specs?

I ran some tests on a 10000x10000 px image, expanding the canvas by 3000 px:

Method 1: 23 s
Method 3: 10 s ("edge_fast")

(64 bit Win 7, i7 3,07 GHz, 6 GB RAM, restarting PS between each test)

I had a closer look, and your method was clever in the way it selected just the part of the image needed to be flipped. I see only minor potential for some further optimization (layer-via-copy instead of copy/paste, etc. and it could also be adapted to work with foreign-language versions of Photoshop (name the layers when making them - don't rely on Photoshop's default names).
But for now I think it fast enough for our/your use, so I don't think it's worth the extra effort right now.
Reply With Quote top
  #20  
Old 10-03-2011, 12:52 AM
RobertAsh RobertAsh is offline
Senior Member
Patron
 
Join Date: May 2011
Location: Oakland, CA area
Posts: 380
Re: How to Select an Exact Width from an Edge?

Yep, it's fast Takes 1.5 - 2 min on my Win7 quad-core. Core Image = 30x40 inches @ 360ppi.

Way, way faster than doing it by hand!!

Also, after importing the action I noticed how much work you two put into that action, it has many steps. It's very humbling to have such great people do so much for you. Any time I can return the favor please let me know.

Thanks again, you guys rock! I might just make my exhibition deadline after all

Last edited by RobertAsh; 10-03-2011 at 01:37 AM.
Reply With Quote top
Reply

  RetouchPRO > Tools > Software


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to select all "disparate" pixels? (cs4, M jane255 Photoshop Help 2 08-06-2011 05:26 PM
Select Masked out object ylwdog Photoshop Help 5 03-28-2011 01:27 PM
healing brush: how to avoid color bleeding on edge ronfya Photo Retouching 16 03-24-2011 08:21 AM
Photoshop batch soft edge effect Galen Photoshop Help 3 02-12-2011 08:00 PM
Torn Paper Edge Effect? ahutton Photo-Based Art 2 02-03-2005 09:44 AM


All times are GMT -6. The time now is 07:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved