Home  >  Article  >  Backend Development  >  How to remove image watermarks with one line of Python code

How to remove image watermarks with one line of Python code

WBOY
WBOYforward
2023-04-19 20:13:051878browse

Run the following code

# pip install poimage
import poimage
# 支持jpg、png等所有图片格式
poimage.del_watermark(
    input_image=r"D:\test\程序员晚枫\加了水印的图片.jpg",
    output_image=r'D:\test\程序员晚枫\保存为去除了水印的图片.jpg')

The effect achieved is as follows

How to remove image watermarks with one line of Python code

Existing function

As of the time of publishing this article, In addition to removing watermarks, the poimage library has the following functions:

Function of 1 line of code Click to view the code
add_watermark Add watermark to picture
down4img Download picture
txt2wordcloud Generate word cloud image
pencil4img Portrait to sketch
image2gif Image to Gif

The above is the detailed content of How to remove image watermarks with one line of Python code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete