-interpolate NearestNeighbor behavior
Posted: 2014-03-12T16:31:15-07:00
I am attempting to do 2d 2nd order polynomial warping of an image with a collection of control points.
I need the borders between two color regions to not be interpolated at all. If the source image goes from #00FF00 to #FF0000, then I want the warped image to also have that same transition (though at a different pixel location. I'm also using virtual-pixel Black to ensure that the edges of the warped image stay black.
However, the output of this shows interpolated boundaries with various colors between the two present in the source image at the border. I have also tried -interpolate Integer, and -filter Point, with the exact same effects I am seeing from the above command, where interpolated values are being added to the borders.
How do I apply a distortion without any interpolation, and retain 'hard' edges of the same color boundary in the source image?
I need the borders between two color regions to not be interpolated at all. If the source image goes from #00FF00 to #FF0000, then I want the warped image to also have that same transition (though at a different pixel location. I'm also using virtual-pixel Black to ensure that the edges of the warped image stay black.
Code: Select all
convert IN_FILE -virtual-pixel Black -interpolate NearestNeighbor -distort polynomial "2 $(cat control_points.txt)" OUT_FILE
How do I apply a distortion without any interpolation, and retain 'hard' edges of the same color boundary in the source image?