Distort Not Working

Use this forum for comments, suggestions or problems related to the online ImageMagick Studio web interface @ https://imagemagick.org/MagickStudio.
Post Reply
CaliKat

Distort Not Working

Post by CaliKat »

Neither bilinear nor the perspective distort is working at the Koya IM. It is not responding properly to any of the command numbers.

For instance, I had an image that was 450x292. I entered these numbers:

0,0,450,0,450,292,0,292,50,50,400,50,400,242,50,242

This should have brought the image inward on all 4 sides. What I got instead was a flopped image, as though I'd gone to Transform and used the flop command.

Then I tried 0,0,450,0,450,292,0,292,0,0,400,50,400,242,0,292
but nothing happened.

I love the new distort feature - thank you for adding it... hopefully it will be working again soon.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Distort Not Working

Post by anthony »

What version of IM are you using?

The coordinate system is changing in the very latest IM (v6.3.6-0 beta) to a system of coordinate pairs rather than two sets of coordinates.
Eg: x1,y1,u1,v1 x2,y2,u2,v2 .....
That is x1,y1 maps to u1,v2 in the distorted image space.

The reason is the next release after that will allow more coordinates than the bear minimum with the distortion being fitted using a least squares algorithm. This will make it easier to just add more coordinates on the end of the argument string. It also means a file of the form...

Code: Select all

   x1,y1,u1,v1
   x2,y2,u2,v2
   ...
can be used, allowing the future expandsion to image registration (face finding, panarama composition, movie like image warping etc).

That means your coordinates should be...
'0,0,0,0 450,0,400,50 450,292,400,242 0,292,0,292'
And yes with quotes, spaces can be used instead of commas to make things clearer.

PS: for simple scaling like the affine with three points could be used. (or four points when I get least squares data fitting in place)

Lots more distortions comming including perspective by 3D angle rotations, just as shown by Fred Weinhaus's IM script
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
CaliKat

Re: Distort Not Working

Post by CaliKat »

Thanks so much for the update. Seems that exciting things are underfoot. :)

I am using version 6.3.6. The F/X page has changed since my last visit - took me a moment to find distort. I see a bunch of new additions under the optional attributes but since it is midnight here, playing will have to wait until tomorrow.

Thanks again for the explanation.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Distort Not Working

Post by anthony »

You are really at a bleading edge then, that version is being released offically in a few days, or so I was told.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
CaliKat

Re: Distort Not Working

Post by CaliKat »

Distort is still not working. So far, the image remains completely unchanged by perspective and bilinear operations.... anxiously awaiting its return.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Distort Not Working

Post by anthony »

The latest version 6.3.6 should be reported appropriate errors as to why it didn't work. Typically it is some unknown character in the string. I have had trouble for example with cut and paste from emails that have special UTF spaces, rather that normal spaces. It looks correct but IM tells me there is not enough points, untill I replace all the blanks in the string with normal spaces.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
CaliKat

Re: Distort Not Working

Post by CaliKat »

It's back!! Wooohooooooo!! Yes, that makes me very happy - now to go play. :)

P.S. Thank you for all the wonderful new features at IM. We are having a blast with them.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Distort Not Working

Post by anthony »

Good. Because as soon as I finished adding least squares fitting for more than the minimum number of control coordinates needed for a distort i will be looking to add more distorts.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply