Well that isn't 'point' (unless I get a different image to you) looks more like a triangle filter (bilinear interpolation)NicolasRobidoux wrote:Here is a really compact solution:It will only do what I want when WIDTH divides the width of the input image exactly, and likewise with the HEIGHT, but this is the situation that I care about.Code: Select all
magick INPUT.IMG -filter Box -define filter:blur=0 -distort Resize WIDTHxHEIGHT OUTPUT.IMG
Of course it relies on ImageMagick enlarging the blur just enough to make sure that there is at least one point in the "Box" (which here is a disk).
But then that is what you are getting... blur =0, means support = 0, so no pixels ever get 'hit' and you get a fall back to interpolation type 'point' lookup.
Really Resize with filter point probably should use the new IMv7 operator -interpolative-resize (resize using interpolation only)
But historically filter point (actually a near zero support impulse filter) produces a nearest neighbour interpolation.
ASIDE: I do want to add some other 'unusual' interpolations.
For example a mixed nearest-neighbour and average interpolator. That is if the sample point is 'close' to a pixel, use that, other-wise use average of the nearest pixels.
Another idea is, exact matches uses pixels, otherwise use background color. This can be used to integer 'scale' an image such that the result is much like splicing extra rows and columns of pixels to spread the original pixel. This also would be useful for the unusual EWA Box filter with two small a support.
http://www.imagemagick.org/Usage/resize ... terpolated
uses this interpolation filter in this situation would result in the areas between 'dots' bein the user given background color, rather than the interpolated blended color.