python去除图片水印_Python | 图中使用类的水印
生活随笔
收集整理的這篇文章主要介紹了
python去除图片水印_Python | 图中使用类的水印
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
python去除圖片水印
Sometimes, we need to add watermark as a standard category of plots and therefore, we are introducing a new methodology for adding watermark in this article.
有時,我們需要將水印添加為地塊的標準類別,因此,我們在本文中介紹了一種添加水印的新方法。
使用類的圖中水印的Python代碼 (Python code for watermark in figure using class)
# Data Visualization using Python # WaterMark in Figureimport matplotlib.pyplot as plt from matplotlib.figure import Figure import numpy as npclass WatermarkFigure(Figure):def __init__(self, *args, watermark=None, **kwargs):super().__init__(*args, **kwargs)if watermark is not None:bbox = dict(boxstyle='square', lw=3, ec='gray',fc=(0.9, 0.9, .9, .5), alpha=0.3)self.text(0.5, 0.5, watermark,ha='center', va='center',fontsize=40, color='gray', alpha=0.3, bbox=bbox)x = np.linspace(-3, 3, 201) y = np.exp(-x) + 0.1 * np.cos(5 * x)plt.figure(FigureClass=WatermarkFigure, watermark='Watermark') plt.plot(x, y)Output:
輸出:
Output is as figure翻譯自: https://www.includehelp.com/python/watermark-in-figure-using-class.aspx
python去除圖片水印
總結
以上是生活随笔為你收集整理的python去除图片水印_Python | 图中使用类的水印的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 一加手机6t鸿蒙rom,一加6T官方原厂
- 下一篇: 战略 | 分析这25家千亿美元市值企业后