Page 1 of 1

Can't get Distort to do interpolation

Posted: 2009-05-28T13:23:03-07:00
by Searle
When i do this:

Code: Select all

    $image->Distort("method" => "Perspective",
        "points" => [ 0, 0 => 0.5, 0.5  ... ]
    );
i actually expect IM to interpolate the source pixels and calculate the target pixels.
But I can't get it running. I always get raw source pixels duplicated.

What i tried:
  • Patching IM for Distort to accept the arguments "interpolate", "filter" and "blur" and setting them. Didn't work.
  • Trying to do $image->Set("option", "distort:scale=3") which I found browsing the source code. Didn't work either.
I'm stuck :-(
Any ideas, somebody?

Cheers,
Searle

Re: Can't get Distort to do interpolation

Posted: 2009-05-29T00:12:13-07:00
by anthony
It should work exactly as you defined. If only one point is given. the whole image will be shifted, by half a pixel right and down.

This works for me

Code: Select all

convert rose: +distort Affine '0,0 0.5,0.5' show:
generated a slightly blurred image as ALL the pixels are shifted diagonally half a pixel, and the colors interpolated produces some averaging of the colors.

Re: Can't get Distort to do interpolation

Posted: 2009-05-30T07:06:02-07:00
by Searle
Thanks for helping.

I just understood the concept of virtual canvases which, together with
page.x and page.y attributes, helped. I'ts working fine now...

Cheers,
Searle