possible bug in -displace in IM 6.4.1-7

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug in -displace in IM 6.4.1-7

Post by fmw42 »

I don't know if I am not understanding the instructions for using the y displacement map (mask image) or not. The documentation says:

"However, if you specify mask, composite image is the horizontal X displacement and mask the vertical Y displacement."


Here are my tests:

Image: morphA.gif
Image

X displacement image: triangle_interp_x.png
Image

Y displacement image: triangle_interp_y.png
Image


Displacement along x only: morphA_dx.gif
composite triangle_interp_x.png morphA.gif -displace 100x0 morphA_dx.gif
Image

Displacement along x and y using only x displacement image: morphA_dx_dx.gif
composite triangle_interp_x.png morphA.gif -displace 100x100 morphA_dx_dx.gif
Image

Displacement along x and y using x and y displacement images: morphA_dx_dy.gif
composite triangle_interp_x.png morphA.gif triangle_interp_y.png -displace 100x100 morphA_dx_dy.gif
Image


Am I doing something wrong or is this a bug?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug in -displace in IM 6.4.1-7

Post by magick »

Ping Anthony about this bug, we believe he was in charge of the last few revisions of this option.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug in -displace in IM 6.4.1-7

Post by fmw42 »

Thanks. I sent him a message last night.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: possible bug in -displace in IM 6.4.1-7

Post by anthony »

Summery of very lengthy discussion....


The composite -displace operator using two separate X and Y mapping images has been broken since the three image composite masking was finally correctly fixed to allow for greyscale masks, and blending of the composite and original destination image data.

I have NOT complained about this as composite masking was FAR more important than three image displacement.

I had been planing to properly fix displacement for a long time, but would move image displacement completely out of 'compose' and into the 'distort' modules where it belongs, along with absolute coordinate 'distortion' mapping, as defined by the FX equivalents in IM Examples, Distortion LUT Mapping.

This would also open the way for the future use of 'slope' determinations, allowing for the use of area resampling techniques.

Fred agrees with me that this is the best idea, though it will mean -displace will no longer be available from "composite".

It is on my TODO list.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply