一批图像的水印
watermarkImage的Python项目详细描述
欢迎使用水印图像!
该软件包将允许您为一批图像添加水印。 这个包是用python 3.5.4编写的
您可以使用3种方法:
安装
您可以从pypi安装水印图像:
$ pip install watermarkImage
示例用法:
>>> from watermarkImage import Logic >>> list= Logic.watermarkDir(dirToSearch, logo, Position.TOP_LEFT) >>> Logic.saveImages(list, pathForNewImages)
您可以使用3种方法:
水印目录:
输入:
- dirToSearch: path to folder with all the images you want to watermark. - logo: PIL image object. - Position: one of 4 corners - please use Position enum from the package! - Opacity: opacity of logo (1-10), the default is 5. - Logo size: there are 4 sizes to choose, the default is 2.
输出是PIL图像列表。
水印列表:
与watermarkdir相同,但不是dirtosearch,而是list of images,即pil图像的列表。 输出是一样的。
保存图像:
输入
- listOfImages: list of PIL images. - pathToSave: path to save the watermark images (the folder will be created if not exists).
请注意,该包仅支持jpg\png
许可证
麻省理工学院
免费软件,见鬼!