📐 PNG to SVG Converter

📐 工作原理与说明
降采样网格:宽 = max(1, ceil(原图宽 ÷ 块大小)),高 = max(1, ceil(原图高 ÷ 块大小));逐格读 RGBA,alpha 低于阈值则跳过不绘制;保留格输出 rect,坐标 = 列 × 块大小 / 行 × 块大小,边长 = 块大小,半透明格附加 fill-opacity;SVG 的 width / height / viewBox 保持原图尺寸,超出边缘的末列末行由 viewBox 裁切。
本工具把图片降采样为像素块并输出 SVG 矩形,属于近似转换而非轮廓描摹:保留原始画布尺寸与每块透明度,放大后会看到色块。数据在浏览器本地处理、不上传服务器。

Approximate a PNG as pixel-block SVG (not outline tracing) while keeping original size and transparency; download or copy locally without uploading.

请上传图片

📚 深度解析:PNG 转 SVG

💡 常见使用场景

  • logo 矢量化。
  • 图标放大。
  • 印刷素材。
logo 转 SVG

输入:上传 PNG logo。

处理:按像素块输出 SVG 矩形。

输出:SVG 可下载使用。

❓ 常见问题(FAQ)

复杂图能转吗?
色块边界越规整,近似效果越好;照片细节越多,放大后色块越明显。
转后还能编辑吗?
结果为像素块矩形集合,可在矢量软件里缩放,但放大后仍可见色块边界。
会保存或上传我的内容吗?
结果以浏览器实时计算为准,纯前端本地处理、数据不上传;生成的样式与代码仅作快速产出参考,正式项目请以设计系统、规范与浏览器实测为准。

Formula & Standard References

Item Formula / Note Source / Standard
Tracing nature raster to vector refits outlines and is never lossless Vectorization literature
Colour merging quantize colours then fit region outlines, more regions mean larger files Vectorization literature
Source format PNG is lossless, so avoid a lossy pass before tracing ISO/IEC 15948 (PNG)
⚠️ 使用说明与注意事项