Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help transforming image with minimal distortion
#1
I've tried most of the GIMP transform tools and haven't found one that does what I want.
Attached should be a "before" picture of a grid in which all squares are the same size and shape.
I want to bring the bottom 2 corners of the image inward to achieve a keystone effect. I expect the squares in each row to become quadrilaterals (4 sided polygons) which are narrower than the original squares.
The problem is that all of the transform tools that I have tried also change the height of the rows. Note in that the quadrilaterals in the top row are taller than the original squares and definitely taller than the quadrilaterals in the bottom row, which are now shorter than the original squares.

The end goal is to use a GIMP transform to make an image narrower on one end (the bottom in this example) without distorting the image vertically. Alas, if I use transforms on an image of a person, the person's head will become taller and their legs will become shorter, which is not what I want.

As recommended in other posts (on the Unified Transform, for example) I have read the GIMP online docs and have experimented with various settings, including the pivot point in Unified Transform, but in all my attempts, the transforms have distorted the image vertically.

Your guidance would be greatly appreciated.
Thank you,
PeytonR

Before:      
After:     
Reply
#2
Similar question here: https://www.gimp-forum.net/Thread-Is-it-...9#pid28339
Reply
#3
Probably same result as Ofnuts plugin and more work involved. One of gmics filters Map - Triangular Projection. http://www.gmic.eu
You need to double the canvas height - apply filter - crop back to original size.
Offered just as an alternative.
40 second example https://i.imgur.com/x5Yaavm.mp4
Reply
#4
Maybe it is possible with G'MIC-Qt / Transformations / Cartesian transform, maybe Ofnuts know an expression that does the job.
Some information about the script : https://screamingbrainstudios.com/cartesian-transform/
Reply
#5
Wouldn't making the squares different distort your image anyhow? I'd go for the unified transform or map to plane?


Attached Files Image(s)
   

Smile
Reply
#6
(01-16-2025, 07:03 PM)PeytonR Wrote: I've tried most of the GIMP transform tools and haven't found one that does what I want.
Attached should be a "before" picture of a grid in which all squares are the same size and shape.
I want to bring the bottom 2 corners of the image inward to achieve a keystone effect. I expect the squares in each row to become quadrilaterals (4 sided polygons) which are narrower than the original squares.
----snip----

Bearing in mind the original question Wink

Looking at Ofnuts plugin ofn-trapeze-transform.py I can not get an "easy" outcome and it is slow, rendering strips of the image.

   

Back to the gmic_gimp_qt plugin http://www.gmic.eu  and using one of the map filters - triangular projection. more explanation than the earlier animation.

   

(1) Transparency required. Use Layer -> Transparency -> Add Alpha Channel
(2) It is a Map projection and needs a North and South pole with center of the image the Equator. Double the height of the image. Gimp can do the arithmetic for you if you want height*2 or enter the value yourself.
(3) The default is image at the top. Click-Drag the image icon down to bottom in the small preview window.
(4) Check that Fill width is set to transparency and click resize.

---- on to gmic--- bottom of the filters menu

(5) There are 600+ filters. Use the search for map
(6) Locate the Triangular Projection filter.
(7) Set the Background Opacity to zero
(8) Adjust the Width to suit and OK to apply the filter

(9) To remove the excess transparency, Image -> Crop to Content. Easy.
Reply
#7
(01-18-2025, 10:15 AM)rich2005 Wrote:
(01-16-2025, 07:03 PM)PeytonR Wrote: I've tried most of the GIMP transform tools and haven't found one that does what I want.
Attached should be a "before" picture of a grid in which all squares are the same size and shape.
I want to bring the bottom 2 corners of the image inward to achieve a keystone effect. I expect the squares in each row to become quadrilaterals (4 sided polygons) which are narrower than the original squares.
----snip----

Bearing in mind the original question Wink

Looking at Ofnuts plugin ofn-trapeze-transform.py I can not get an "easy" outcome and it is slow, rendering strips of the image.



Back to the gmic_gimp_qt plugin http://www.gmic.eu  and using one of the map filters - triangular projection. more explanation than the earlier animation.



(1) Transparency required. Use Layer -> Transparency -> Add Alpha Channel
(2) It is a Map projection and needs a North and South pole with center of the image the Equator. Double the height of the image. Gimp can do the arithmetic for you if you want height*2 or enter the value yourself.
(3) The default is image at the top. Click-Drag the image icon down to bottom in the small preview window.
(4) Check that Fill width is set to transparency and click resize.

---- on to gmic--- bottom of the filters menu

(5) There are 600+ filters. Use the search for map
(6) Locate the Triangular Projection filter.
(7) Set the Background Opacity to zero
(8) Adjust the Width to suit and OK to apply the filter

(9) To remove the excess transparency, Image -> Crop to Content. Easy.
Nice find rich, never thought it was that easy. Thanks.
Reply


Forum Jump: