Gimp-Forum.net
Warp / transform image along path - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Warp / transform image along path (/Thread-Warp-transform-image-along-path)



Warp / transform image along path - asdthy - 12-20-2017

Hi,
I'd like to shift an image to fit a path that I've drawn. There used to be a plugin/script that did this but i can't find it anymore.
I have a few scanned images from paper sections that were a meter or more long and the images are skewed along the length varying amounts somewhat randomly.
Basically I'd draw a path along one border line of the skewed image. I'd then draw horizontal path. The plugin would subtract the space between the 2 paths in line with the vertical direction of the image.
This worked really well and  I have some other cases where I'd like to do this, but as I said I can't find the plugin anymore.

Has anyone ever done something like this or have any ideas? 

Thanks
Matt


RE: Warp / transform image along path - Ofnuts - 12-20-2017

If you mean straighten an image by drawing a path over something that should be exactly horizontal, then maybe ofn-layer-straightener on https://sourceforge.net/projects/gimp-tools/files/scripts/

Otherwise, maybe give an example (image, screenshots...)


RE: Warp / transform image along path - asdthy - 12-21-2017

(12-20-2017, 11:42 PM)Ofnuts Wrote: If you mean straighten an image by drawing a path over something that should be exactly horizontal, then maybe ofn-layer-straightener on https://sourceforge.net/projects/gimp-tools/files/scripts/

Otherwise, maybe give an example (image, screenshots...)

I've checked that out, unfortunately, it only rotates the image to horizontal. I need it to shift the columns of pixels vertically by the distance between 2 paths.
I've sketched this out. Basically throw away the hashed bit to flatten the wiggly line.

[Image: shift_1.jpg?dl=0]
https://www.dropbox.com/s/epq4kpm32f770c8/shift_1.jpg?dl=0


RE: Warp / transform image along path - Ofnuts - 12-21-2017

So you have two paths, a straight one and a wavy one, and you delete the image between the two paths (it becomes transparent? filled with color?) and you shift/rotate the image so that the straight path ends up somewhere (but how this is determined isn't clear).


RE: Warp / transform image along path - asdthy - 12-21-2017

(12-21-2017, 08:17 AM)Ofnuts Wrote: So you have two paths, a straight one and a wavy one, and you delete the image between the two paths (it becomes transparent?  filled with color?) and you shift/rotate the image so that the straight path ends up somewhere (but how this is determined isn't clear).

It's a straight translation, straight as in vertical, no rotation. A pixel with a location of x1,y1 gets shifted to x1,y2 where y2 is related to the distance between the values of y on the warped edge and the straight reference line. Something like this, if the green & yellow cells are the image and the black are the reference line. The pixels between are overwritten.

https://www.dropbox.com/s/7xeawntv7z3cp5u/this1.png?dl=0

Thanks for looking at this.

Matt


RE: Warp / transform image along path - rich2005 - 12-21-2017

Never come across a Gimp script/plugin that uses paths to remove an area.

There is the liquid rescale plugin that might work

the plugin
[attachment=1157]

the result
[attachment=1158]


RE: Warp / transform image along path - asdthy - 12-21-2017

(12-21-2017, 09:34 AM)rich2005 Wrote: Never come across a Gimp script/plugin that uses paths to remove an area.

There is the liquid rescale plugin that might work

the plugin


the result
This looked pretty promising and I spent an hour or so trying to get it to work but it modifies the image in a way that isn't what i need.
The idea behind it is pretty cool though.