【发布时间】:2019-01-31 08:12:04
【问题描述】:
我正在使用 PIL 调整图像大小,我的情况是放大原始图像。
我对 `resample=ANTIALIAS' 使用的算法感到困惑。
根据下面的文档,ANTIALIAS 在缩小时似乎是最好的。我想知道BICUBIC在哪种情况下可以获胜?(我的一些测试用例显示双三次是更好的选择)
An optional resampling filter.
This can be one of NEAREST (use nearest neighbour),
BILINEAR (linear interpolation in a 2x2 environment),
BICUBIC (cubic spline interpolation in a 4x4 environment),
or ANTIALIAS (a high-quality downsampling filter).
If omitted, or if the image has mode “1” or “P”, it is set NEAREST.
我也对文档中的linear interpolation in a 2x2 environment 和cubic spline interpolation in a 4x4 environment 感到困惑。这里是什么意思?
谢谢。
【问题讨论】:
-
哇。我一直都知道 PIL 有点混乱,但直到查看代码我才意识到有多少。稍后我会尝试进行全面调查。
标签: python image image-processing python-imaging-library interpolation