Hi,

First off, a confession. I'm not too familiar with image processing stuff, so 
when I needed some resizing code for a tool I was writing, I based mine heavily 
on ImageBufAlgo's resize(). Thanks for the excellent resource.

In this tool, the user specifies both the image size and also the filter, which 
led to the eventual realisation that OIIO's resize (and therefore my homage) 
doesn't upsize with non-scalable filters, as demonstrated in this invocation of 
oiitool :

oiiotool --create 10x10 3 --fill:color=1,1,1 0,0,10,10 --resize:filter=catrom 
100x100 -o test.png

It seems that when upsizing, the filter falls through the cracks between source 
pixels, because the constructor for catmull-rom and lanczos filters ignores the 
width, and the filter radius is therefore much smaller than the sampling code 
expects. This means that much of the resized image is black rather than the 
expected white.

In my ignorance, I'm wondering what is the right thing to do here, from an 
image processing perspective? Presumably I could just adjust for the fact that 
the filter is created smaller than expected, and scale the lookup locations on 
the way in, but is that meaningless? Are these filter types simply not intended 
for upscaling? Would it be better to silently substitute in a different filter, 
or perhaps to raise an error?

Thanks in advance for any suggestions you could provide...
Cheers...
John



_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to