2Bdecided
2nd April 2010, 13:20
This sounds such an easy problem, so hopefully I'm just being daft, because I'm finding it almost impossible to solve.
Let's say I want to process something at double height (or double width, or double size!), and then return to the original height.
Obviously(!) if the process becomes a NOP, then I want the whole thing to become a NOP. Therefore double_height followed by halve_height must be a NOP.
It works fine with point resize...
pointresize(width(last),height(last)*2)
#processing goes here
pointresize(width(last),height(last)/2)
...but I don't want to upscale using point resize! I want the "new" pixels to be interpolated (e.g. bilinear, bicubic, etc upsize), not duplicated.
This turns out to be really tricky!
This works...
nnedi2(field=1,dh=true)
#processing goes here
pointresize(width(last),height(last)/2)
...but nnedi2 is overkill.
This doesn't work...
bilinearresize(width(last),height(last)*2)
#processing goes here
pointresize(width(last),height(last)/2)
...you get a sub-pixel shift, and interpolated (rather than original) pixels come out at the end.
Any ideas?
Cheers,
David.
Let's say I want to process something at double height (or double width, or double size!), and then return to the original height.
Obviously(!) if the process becomes a NOP, then I want the whole thing to become a NOP. Therefore double_height followed by halve_height must be a NOP.
It works fine with point resize...
pointresize(width(last),height(last)*2)
#processing goes here
pointresize(width(last),height(last)/2)
...but I don't want to upscale using point resize! I want the "new" pixels to be interpolated (e.g. bilinear, bicubic, etc upsize), not duplicated.
This turns out to be really tricky!
This works...
nnedi2(field=1,dh=true)
#processing goes here
pointresize(width(last),height(last)/2)
...but nnedi2 is overkill.
This doesn't work...
bilinearresize(width(last),height(last)*2)
#processing goes here
pointresize(width(last),height(last)/2)
...you get a sub-pixel shift, and interpolated (rather than original) pixels come out at the end.
Any ideas?
Cheers,
David.