• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Make Rectangle from Trapezoid

Engaged ,
Sep 15, 2018 Sep 15, 2018

Copy link to clipboard

Copied

Hello everyone,

I have a trapezoid and i want to turn it to rectangle by using script.

it is basically something like this:

BEFORE

1.JPG

AFTER

4.JPG

i need to find the width of the small side of the trapezoid, in our case it's 2043px:

3.JPG

and after the transform the other side will be 2043 as well:

5.JPG

any ideas?

TOPICS
Actions and scripting

Views

10.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Sep 26, 2018 Sep 26, 2018

Votes

Translate

Translate
Adobe
Engaged ,
Jan 30, 2019 Jan 30, 2019

Copy link to clipboard

Copied

r-bin​ I've noticed we solved these two issues in this thread:

1. Straightening Trapezoid

example:

BEFORE

trapezoid-before.jpg

AFTER

trapezoid-after.jpg

2. Straightens any quadrangle to rectangle

example:

BEFORE

trapezoid-before.jpg

AFTER

ts1a.jpg

How can I solve my initial problem which is turning trapezoid to rectangle but keeping on original X1 and X2

(X1 and X2 being the coordinates of the top side of the trapezoid)

BEFORE

AFTER

any help?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

All this is unnecessary nonsense.

strai4.jsxbin - Google Drive

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 01, 2019 Feb 01, 2019

Copy link to clipboard

Copied

it worked always helpful.

why "All this is unnecessary nonsense." though?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 21, 2019 Feb 21, 2019

Copy link to clipboard

Copied

r-bin​ i may need your help another time.

We solved these issues in this thread:

1. Straightening Trapezoid

2. Straightening any quadrangle to rectangle

3. Make Rectangle from Trapezoid

I need help with straightening only the bottom

example:

BEFORE

AFTER

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 23, 2019 Feb 23, 2019

Copy link to clipboard

Copied

r-bin​ help please? (straightening only the bottom side)

perhaps using jsxbin

BEFORE

AFTER

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Feb 26, 2019 Feb 26, 2019

Copy link to clipboard

Copied

strai5.jsxbin - Google Drive

But this is all nonsense. In the fully automatic mode, it is impossible to pinpoint the points, the line between which you want to make horizontal.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 26, 2019 Feb 26, 2019

Copy link to clipboard

Copied

Awesome as always

to your remark, it doesn't have to be perfect, but it does the trick. I made a script myself that does something close to this:

as the canvas is cropped to the layer, I loop through last row and find the first non white pixel then I rotate it until it is straight. Your jsxbin is way faster.

I really want to understand the "this is all nonsense" because you wrote it 3 times.

i also didn't understand what is "fully automatic mode", is this a mode? haha

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Mar 13, 2019 Mar 13, 2019

Copy link to clipboard

Copied

AG_Ps_100

I really want to understand the "this is all nonsense" because you wrote it 3 times.

i also didn't understand what is "fully automatic mode", is this a mode? haha

Well, you finally understand?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 13, 2019 Mar 13, 2019

Copy link to clipboard

Copied

You the only one who would know that !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 12, 2019 Mar 12, 2019

Copy link to clipboard

Copied

r-bin​ sorry to bring up this jsxbin thread from the dead. but i want your advise on couple of them.

You shared these jsxbins:

straightens any quadrangle to rectangle.jsx

strai5.jsxbin

I wonder if some of these can straighten based on certain given percent in the next 3 examples, and i'll explain:

1. I have this image

if i use straightens any quadrangle to rectangle.jsx i get:

i want the jsxbin to work on the upper 75%. (and the rest of the layer would follow through):

2. I have this image

if i use straightens any quadrangle to rectangle.jsx i get:

i want the jsxbin to leave out 10% from top and 10% from bottom and work on middle 80%. (and the rest of the layer would follow through):

3. finally i have this image

if i use strai5.jsxbin i get:

i want the jsxbin to somehow find where this line ends.

for the sake of try let's say leave out 30% from the left and 30% from the right and work on middle 40%. (and the rest of the layer would follow through):

that's all

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 25, 2019 May 25, 2019

Copy link to clipboard

Copied

r-bin​ i found a way of doing finally haha

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 26, 2019 May 26, 2019

Copy link to clipboard

Copied

... but you don't want to share your solution with the others?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 26, 2019 May 26, 2019

Copy link to clipboard

Copied

Oh i didn't think someone else needs it,

What I basically did was:

1. Make the changes to canvas I mentioned above, example: 80% to MIDDLECENTER

2. create a smart object

3. Straighten using r-bin script (bounds of layer have now changed, so the layer is fitted on canvas)

4. edit contents and go back to previous dimensions

5. save and close (it will be a psb file)

6. crop selection

works like a charm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

LATEST

Hello I have same problem. I have a trapezoid picture and i want convert it to rectangel, would you please share the solution with me?

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines