Resize using center of pixel (not edge)
Posted: 2011-05-28T09:34:20-07:00
Anthony:
I feel quite strongly that in many common situations one should use the "align corner pixel centers" convention when enlarging images.
(Unfortunately I have no time for IM hacking right now.)
Does the following code use the "nice" virtual pixel policy which one, I believe, gets with -distort resize?
I (of course) want to use this with, among other things, Jinc lanczossharp, which is a method that really impressed LGM 2011 conference attendees. (I told them I was using JInc lanczos for simplicity, but they were shown Jinc lanczossharp results.)
(I don't care about speed. Only quality.)
Dear Santa: Could you please give me a -distort resize for which I can choose between the "align corner pixel corners" (current IM default) and the "align corner pixel centers" image alignment conventions (what I want for upsampling)? Even better, could I have the same options with -resize as well?
I feel quite strongly that in many common situations one should use the "align corner pixel centers" convention when enlarging images.
(Unfortunately I have no time for IM hacking right now.)
Does the following code use the "nice" virtual pixel policy which one, I believe, gets with -distort resize?
I (of course) want to use this with, among other things, Jinc lanczossharp, which is a method that really impressed LGM 2011 conference attendees. (I told them I was using JInc lanczos for simplicity, but they were shown Jinc lanczossharp results.)
(I don't care about speed. Only quality.)
P.S.anthony wrote:...
A variation on this (not shown on the page) is to use a two point affine distortion (distorting using the middle of pixels...Code: Select all
convert \( xc:red xc:blue +append \) \ \( xc:yellow xc:cyan +append \) -append \ -filter point -interpolate bilinear -define distort:viewport=100x100 \ -distort Affine '.5,.5 .5,.5 1.5,1.5 99.5,99.5' interpolate_bilinear.jpg
That is equivalent to the FX method and is faster but as you can see needs some setup.
Dear Santa: Could you please give me a -distort resize for which I can choose between the "align corner pixel corners" (current IM default) and the "align corner pixel centers" image alignment conventions (what I want for upsampling)? Even better, could I have the same options with -resize as well?