温馨提醒

如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢

本文最后更新于2024年12月18日,已超过 180天没有更新

专门用于给图片加水印打码的工具,完全基于浏览器本地API,无任何网络请求(特别适合身份证等敏感证件)。

HTML源码如下:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>图片水印打码工具</title>
    <style>
        #container {
            max-width: 500px;
            margin: 30px auto;
        }

        h1 { margin: 0 }
        p, article { margin: 0 0 20px 0 }
        article { font-size: 14px; color: #777 }

        label { color: blue; font-size: 17px }
        p label { color: black; display: inline-block; margin-right: 5px; font-size: 15px }
        p { font-size: 15px; line-height: 30px }
        p > * { vertical-align: middle }

        input#text { width: 100%; box-sizing: border-box; font-size: 16px; margin-bottom: 10px }
        input[type=range] { width: 200px; height: 18px; }

        canvas { box-sizing: border-box; width: 100%; border: 1px dashed #AAA; cursor: pointer }
    </style>
</head>
    <div id="container">
        <h1>图片水印打码工具</h1>
        <article>安全地为你的图片加水印,无任何网络请求,特别适合各种敏感证件(身份证,驾照,护照等)。<a href="https://github.com/joyqi/sfz">Github地址</a></article>

        <label for="image">第一步:先选择一张本地图片</label>
        <p><input type="file" id="image" autocomplete="off"></p>

        
        <label for="text">第二步:输入需要打水印的文字</label>
        <p><input type="text" id="text" placeholder="请输入文字" autocomplete="off" maxlength="30">
        
        <label for="color">颜色</label>
        <input type="color" id="color" pattern="#[0-9A-Fa-f]{6}" autocomplete="off" value="#0000FF"><br>
        
        <label for="alpha">透明度</label>
        <input type="range" id="alpha" min="0" max="1" step="0.05" autocomplete="off" value="0.15"><br>
        
        <label for="angle">角度</label>
        <input type="range" id="angle" min="-90" max="90" step="3" autocomplete="off" value="45"><br>

        <label for="space">间隔</label>
        <input type="range" id="space" min="1" max="8" step="0.2" autocomplete="off" value="4"><br>
        
        <label for="size">字号</label>
        <input type="range" id="size" min="0.5" max="3" step="0.05" autocomplete="off" value="1">
        </p>
        
        <label for="text">第三步:点击图片下载</label>
        <p>
            <label for="auto-refresh">实时刷新</label>
            <input type="checkbox" id="auto-refresh" autocomplete="off" checked>
            <button id="refresh" disabled>刷新</button>
        </p>
        <p id="graph"></p>
    </div>
    <script src="./build/script.js"></script>
</html>

Github地址:https://github.com/joyqi/sfz/

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系客服QQ3387285338进行处理。