Python实现图像扩展(expand)支持自定义四个方向的扩展量

能够利用Pillow的ImageOps模块实现图像的边界扩展(有点相似于Photoshop扩大画布的操做,各个方向的扩展的大小能够自行调节),示例代码:python from PIL import Image, ImageOps img = Image.open('test.jpg') img.show() left_pad = 100 top_pad = 50 right_pad = 16
相关文章
相关标签/搜索