<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>WASM on FXIO 技术博客</title><link>https://fxio.site/tags/wasm/</link><description>Recent content in WASM on FXIO 技术博客</description><generator>Hugo -- 0.157.0</generator><language>zh-cn</language><lastBuildDate>Tue, 18 Aug 2026 17:36:00 +0800</lastBuildDate><atom:link href="https://fxio.site/tags/wasm/index.xml" rel="self" type="application/rss+xml"/><item><title>纯前端 AI 证件照制作工具：本地抠图换底色，免费无需上传</title><link>https://fxio.site/posts/tools/idphoto-ai-tool/</link><pubDate>Tue, 18 Aug 2026 17:36:00 +0800</pubDate><guid>https://fxio.site/posts/tools/idphoto-ai-tool/</guid><description>&lt;h2 id="背景"&gt;背景&lt;/h2&gt;
&lt;p&gt;办身份证、社保卡、护照、港澳通行证、驾照，都需要证件照和回执。线下照相馆收 ¥10~20，线上小程序也差不多。&lt;/p&gt;
&lt;p&gt;其实只要两步：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;拍照&lt;/strong&gt;：微信搜「智绘免费证件照制作」小程序，手机拍就行&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;回执&lt;/strong&gt;：上 &lt;a href="https://rzzx.com.cn"&gt;rzzx.com.cn&lt;/a&gt;「证件数码相片质量检测中心」，官方渠道只要 ¥1.5&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;但很多同学拍出来的照片背景杂乱（白墙有阴影、灰底、杂色），不符合要求。下面这个工具可以直接在浏览器里完成 &lt;strong&gt;AI 自动抠图 + 换纯白/蓝/红底色&lt;/strong&gt;，全程本地处理，照片不出浏览器。&lt;/p&gt;
&lt;h2 id="证件照要求速查"&gt;证件照要求速查&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;背景必须纯白、红或蓝色（&lt;strong&gt;严禁灰色背景&lt;/strong&gt;）&lt;/li&gt;
&lt;li&gt;禁止翻拍纸质照片（尤其翻拍身份证）&lt;/li&gt;
&lt;li&gt;禁止模糊、水印、变形&lt;/li&gt;
&lt;li&gt;禁止 AI &lt;strong&gt;生成&lt;/strong&gt;的证件照（但抠图换底色属于正常修图，没问题）&lt;/li&gt;
&lt;li&gt;头顶与照片上边距要有一定距离&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="在线工具"&gt;在线工具&lt;/h2&gt;
&lt;p&gt;直接在下面操作，上传照片 → 选规格 → 选底色 → 生成下载：&lt;/p&gt;
&lt;script src="https://fastly.jsdelivr.net/npm/@imgly/background-removal@1.4.5/dist/bundle.js" crossorigin="anonymous"&gt;&lt;/script&gt;
&lt;div class="idphoto-tool" style="max-width:800px;margin:24px auto;background:#fff;border-radius:16px;box-shadow:0 4px 20px rgba(0,0,0,0.06);padding:20px;border:1px solid #e2e8f0;"&gt;
&lt;h2 style="font-size:1.35rem;text-align:center;margin-bottom:6px;"&gt;📷 AI 证件照生成工具&lt;/h2&gt;
&lt;p style="text-align:center;color:#64748b;font-size:0.8rem;margin-bottom:20px;"&gt;纯本地计算 · 零上传 · 杂色背景换纯白/证件蓝/红&lt;/p&gt;
&lt;div style="display:grid;grid-template-columns:1fr 1fr;gap:20px;"&gt;
&lt;!-- 控制面板 --&gt;
&lt;div style="border:1px solid #e2e8f0;border-radius:12px;padding:16px;background:#fafafa;"&gt;
&lt;div style="margin-bottom:14px;"&gt;
&lt;label style="display:block;font-size:0.85rem;font-weight:600;margin-bottom:6px;"&gt;1. 上传自拍照（支持拍照或相册选择）&lt;/label&gt;
&lt;input type="file" id="imageInput" accept="image/*" style="width:100%;padding:10px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;font-size:0.85rem;"&gt;
&lt;/div&gt;
&lt;div style="margin-bottom:14px;"&gt;
&lt;label style="display:block;font-size:0.85rem;font-weight:600;margin-bottom:6px;"&gt;2. 证件照尺寸规格&lt;/label&gt;
&lt;select id="specSelect" style="width:100%;padding:10px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;font-size:0.85rem;"&gt;
&lt;option value="295x413"&gt;标准 1 寸 (25mm × 35mm / 295×413 px)&lt;/option&gt;
&lt;option value="413x579"&gt;标准 2 寸 (35mm × 49mm / 413×579 px)&lt;/option&gt;
&lt;option value="390x567"&gt;大 1 寸 / 护照 / 签证 (33mm × 48mm)&lt;/option&gt;
&lt;option value="original"&gt;保持原图比例 (仅换底色)&lt;/option&gt;
&lt;/select&gt;
&lt;/div&gt;
&lt;div style="margin-bottom:14px;"&gt;
&lt;label style="display:block;font-size:0.85rem;font-weight:600;margin-bottom:6px;"&gt;3. 选择底色&lt;/label&gt;
&lt;div style="display:flex;gap:12px;"&gt;
&lt;div class="color-btn active" data-color="#FFFFFF" style="width:36px;height:36px;border-radius:50%;border:2px solid #cbd5e1;cursor:pointer;background:#FFFFFF;" title="纯白底"&gt;&lt;/div&gt;
&lt;div class="color-btn" data-color="#438EDB" style="width:36px;height:36px;border-radius:50%;border:2px solid #cbd5e1;cursor:pointer;background:#438EDB;" title="证件蓝"&gt;&lt;/div&gt;
&lt;div class="color-btn" data-color="#C40000" style="width:36px;height:36px;border-radius:50%;border:2px solid #cbd5e1;cursor:pointer;background:#C40000;" title="证件红"&gt;&lt;/div&gt;
&lt;div class="color-btn" data-color="#F2F4F7" style="width:36px;height:36px;border-radius:50%;border:2px solid #cbd5e1;cursor:pointer;background:#F2F4F7;" title="浅灰底"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;button id="generateBtn" style="width:100%;padding:12px;background:#2563eb;color:white;border:none;border-radius:8px;font-size:0.95rem;font-weight:600;cursor:pointer;"&gt;开始生成证件照&lt;/button&gt;&lt;/p&gt;</description></item></channel></rss>