超简单~ Python添加水印,三行代码教你批量添加

利用python实现添加水印和去水印的小代码 python去水印,加水印 阅读详情

环境使用:

  • Python 3.8
  • Pycharm

如何配置pycharm里面的python解释器?

  • 选择file(文件) >>> setting(设置) >>> Project(项目) >>> python
    interpreter(python解释器)
  • 点击齿轮, 选择add
  • 添加python安装路径

pycharm如何安装插件?

  • 选择file(文件) >>> setting(设置) >>> Plugins(插件)
  • 点击 Marketplace 输入想要安装的插件名字 比如:翻译插件 输入 translation / 汉化插件 输入 Chinese
  • 选择相应的插件点击 install(安装) 即可
  • 安装成功之后 是会弹出 重启pycharm的选项 点击确定, 重启即可生效

模块使用:

  • filestools (第三方模块,需要安装)

安装python第三方模块:

  • win + R 输入 cmd 点击确定, 输入安装命令 pip install 模块名 (pip install requests) 回车
  • 在pycharm中点击Terminal(终端) 输入安装命令 安装下载速度太慢,或者报错了,可以切换镜像源安装

代码

一、单张图片添加水印

怎么使用 filestools 模块呢?

首先导入模块里面的一个方法,watermarker ,点上 marker ,然后 import add_mark

原码.点击即可领取 【备注:苏】
from watermarker.marker import add
Python添加水印简简单单,三行代码教你批量添加 打码分享了,就来分享一下添加水印吧 阅读详情

相关推荐

使用Python编写批量添加图片水印程序

文章目录 一、为什么要为图片添加水印 二、利用Python为图片添加水印 遍历文件夹下所有图片文件 三、利用QT for Python制作图片水印添加程序 一、为什么要为图片添加水印 在互联网写文章最头疼的一件事情就是发表的文章容易被抄袭,各种抄袭的手段真的是层出不穷。无奈,只能在不影响阅读体验的情况下不断地提高反抄袭的难度。虽然防不住,但是为文章中的图片添加水印,至少能够保证文章被...

9363

用python给pdf批量添加水印,并给pdf加密

本文参考:https://blog.csdn.net/oh5w6hinug43jvrhhb/article/details/80879026 设置路径 先设置路径,把需要加水印的相关文档放入一个目录下。我的目录是:E:\python\test\pdf批量加水印os.chdir('E:\\python\\test\\pdf批量加水印\\') 准备水印pdf文件 如下代码所示。若水印为中文...

idontknow0_0的博客 1万+

Python实现超简单【抖音】无水印视频批量下载

我们可以看到上面选中的那个请求,返回的是一串json,我们将内容复制下来看看,搜索返回的json中有关video的字段,通过下图我们就可以看到video里面有个url_list,里面有两个不同的url,这两个url其实就是视频相关的地址了,但是还有点问题,这两个url点进去并不能直接看到视频。其实我们一开始拿到的url就是无水印的,但是链接本身并没重定向到无水印的视频,加上wm之后,url会重定向到有水印的视频。我们刚刚获取了视频主页的链接,现在我们要通过主页链接来获取当前页面下的所有视频。

2401_87361558的博客 4665

Python两三行代码轻松批量添加~防韩还是很有必要的~

使用python批量添加水印,一键防韩❤

xff123456_的博客 1522

简易版 批量添加水印(一)

简易版 批量添加水印

weixin_43844548的博客 2399

Python图像处理:批量添加水印的优雅实现与进阶技巧

在日常图像处理中,为图片添加水印是一项常见任务。有多种方法和工具可供选择,而今天我们将专注于使用Python语言结合PIL库批量添加水印。需要注意的是,所选用的图片格式不应为JPG或JPEG,因为这两种格式的图片不支持透明度设置。先前的文章已经详细介绍过PIL库,这里不再赘述。PIL是Python的图像处理库,支持多种文件格式。PIL提供强大的图像和图形处理功能,包括缩放、裁剪、叠加以及添加线条、文字等操作。

mate1357的博客 2225

Python实战:批量水印添加

本文将介绍如何使用Python编写一个批量水印添加器,该工具可以为图片或文档添加水印。我们将详细介绍工具的原理、设计和实现过程,并提供完整的代码示例。

oandy0的博客 1530

python使用filestools包中的add_mark函数为指定目录下的所有图片添加自定义水印(自定义水印内容、字体大小、字体间距、透明度、字体颜色等)、注意直接把目录下的图片替换了

python使用filestools包中的add_mark函数为指定目录下的所有图片添加自定义水印(自定义水印内容、字体大小、字体间距、透明度、字体颜色等)、注意直接把目录下的图片替换了(如有需要做好备份或者额外指定保存路径)

statistics+insight+vista+power 453

Qt EGLFS 图形后端详解

EGLFS (EGL Full Screen) 是Qt框架在嵌入式Linux系统中的高性能图形显示后端,它提供了直接基于EGL和OpenGL ES的硬件加速渲染解决方案。

浩瀚之水的专栏 522

置顶必读(1) |《滚雪球学SpringBoot 3.x》· 高质量专栏介绍,你值得拥有!

《滚雪球学SpringBoot 3.x》 并不是普通的技术讲解合集,它是专为开发者精心设计的系统化学习路径。通过不断“滚动学习”,我们将带领你从基础入门到高阶应用,从理解每一行代码到设计和优化大规模分布式系统,最终帮助你成长为一位精通 spring架构 的工程师。

**My Coding Family** 12万+

开源GIS -- 笔记

基础开发库 数据读写:GDAL/OGR(C/C++) ArcGIS和GE都是使用此工具 投影转换:Proj.4(C/C++) 拓扑计算:JTS(Java),GEOS(C++),Shapely(python) 组件式开发库 GeoTools(Java),DotSpatial(.NET) 空间分析: Scipy(通用科学计算、方程求解), numpy,NextworkX, rPy(统计分析), Scikit-learn,pysal(空间分析) 深度学习: Keras、 tensorflow、 pytor

DZ Space 4521

Android CPU调度优化完整分析 - 小白入门到精通

本文全面解析Android CPU调度优化技术,从硬件架构到内核实现。首先介绍ARM big.LITTLE架构的硬件拓扑和性能层级,包括大核、小核和DynamIQ技术。然后深入讲解CPU性能状态管理(P-states和C-states)和硬件计数器支持。内核层部分详细分析调度器架构,包括调度类层次结构和核心调度实体实现,重点剖析CFS调度器的虚拟运行时间计算、红黑树操作和PELT负载跟踪算法。最后探讨负载均衡触发条件和实现机制。全文循序渐进,为开发者提供完整的Android CPU调度优化知识体系。

xhxh510573522125的博客 157

Android Framework WMS全面概述和知识要点

WindowManagerService 类是整个 WMS 的核心大脑,处于系统服务层,负责协调和管理所有与窗口相关的操作。它在 Android 系统架构中起到承上启下的关键作用,向上对接应用层的窗口请求,向下与 SurfaceFlinger 等底层组件交互,确保窗口能够正确地在屏幕上显示和管理。

大模型大数据攻城狮的专栏 1804

手把手教你学Simulink——基于Simulink的CLLC谐振变换器双向对称控制

本文介绍了一种基于Simulink的CLLC谐振变换器双向对称控制方法。针对CLLC拓扑的多阶谐振特性,采用固定频率、50%占空比、仅调节相位差的对称控制策略,实现了宽电压范围调节和全负载ZVS软开关。详细阐述了Simulink建模步骤,包括功率级搭建、相位差生成逻辑和双向切换实现,并通过仿真验证了稳态性能和双向无缝切换能力。该方法解决了传统PFM控制的不足,具有控制简单、效率高、易于工程实现的优势,适用于车载充电和储能系统等双向功率应用场景。

MHD0815的博客 306

PyTorch实战(2)——使用PyTorch构建神经网络

在本节中,我们使用 PyTorch 在简单数据集上构建了一个神经网络,训练神经网络来映射输入和输出,并通过执行反向传播来更新权重值以最小化损失值,并利用 Sequential 类简化网络构建过程;介绍了获取网络中间值的常用方法,以及如何使用 save、load 方法保存和加载模型,以避免再次训练模型。

盼小辉丶的博客 1万+

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

上一篇: 好无聊啊~ 来试试用Python采集下载漫画【附原码哟~】
下一篇: 周报没有日报烦,怎么用Python实现自动生成日报数据?
苏南Python~
博客等级 码龄4年 168粉丝 15原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址