What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Help needed on a slightly complicated procedure...


vejito

New Member
Messages
4
Likes
0
So once I have an image (780 x 640) I need to re-size it to a 780 x 780 square. I can script that pretty easily.

Here is where it will get complicated, so I'll explain what I need before saying how I'm going to get it to work.

With the image, the user should be able to draw a line of a certain width across the image. Now whatever part the line is "filling" in the image will be left alone and the rest of the image will be cropped. In the end, there will be a strip of the original image that has the same dimensions as the "line" the user drew.

Also the strip has to be perfectly horizontal. So even if the line was drawn on a slanted and it could be even off centered, the strip will "grab" that information from the image and make a strip and rotate it so it is horizontal.

My idea was to create a layer underneath the image and create a clipping mask on the image layer. This will give me a "line" or strip from the image that I want. Again, I'm sure I can script this part too.

The part where I'm stuck is: once all I have is this arbitrarily slanted strip with everything else transparent, how to trim it. If I tried ordinary trimming, all it will do is trim it until the sides hit the strip.

Is there no option in PS to remove all the transparency so that it automatically has to rotate it leaving only pixels that are non-transparent...?

I hope that made sense. I suck explaining things. So if you need more details, please ask.
 
ok scripting things is a no go for me what you typed to all I read of it was you want prt of an image enlarged but I am sure that is not what your asking as to resizing something into a different size which by the way I am sure your not asking but at 6 am it is all I am getting lol my suggestion would be to crop the image to the exact part you want then use something like genuine fractals to resize image to your specif size. this plug in will do an excellent at making up pixels that are not there. but then I may have (probably) misunderstood you all together ( probably lol almost guarenteed) i would say let me know if i can be of any more help but I am sue you wont be requiring my services any longer
 
Thanks for replying. I think I may have not been clear. I'll walk through the steps again using screenshots.

So here is an image of 780x640. The resizing of the canvas isn't necessary and I know how to script that so I'll skip that step on here.
1.jpg


____
Next step is to create a layer underneath the image layer. (I can script all of this easily.)
2.jpg


____
Now I can create an arbitrary line (I made it 10 px to make it easy to see what I'm doing. Really it will be 4px or smaller.) on the new layer. (This is where the "user input" is needed. And after done the user will use a short-key to trigger the next step.)
3.jpg


____
The trigger will create a clipping mask on the top image layer. (Now this effectively create a strip, of whatever the user chose from before, from the original image. The different ways the line could be drawn is endless since the clipping mask will always only "choose" what the line goes over the original image. But lets keep using the line that I made for now.)
4.jpg


____
Now this is where I need help. What is a good "one-size-fits-all" solution to take any strip at this point and figure out how to rotate it and cropped (Only the transparent pixels should be cropped) to where in the end you end up with this:
5.jpg



I hope that helps in understanding what I'm trying to get. Again thanks for the reply.

-edit
I don't know why some of the images are showing up and some are links. So please click on the links to see what I'm talking about.
 
Last edited:

Back
Top