🗜️ PNG 压缩(减色 / 无损优化)Compress PNG
在浏览器里压缩 PNG 并保持 PNG 格式:可减少到 2–256 种颜色(调色板 PNG,保留透明,可选抖动),或只做无损优化(逐行选择最佳滤波 + 最高级别压缩)。显示压缩前后大小,比原图还大时自动保留原文件,可批量处理并打包 ZIP。Compress PNGs in your browser and keep them as PNG: reduce to 2–256 colors (palette PNG with transparency, optional dithering) or optimize losslessly (best filter per row plus maximum compression). Before and after sizes are shown, the original is kept when it is already smaller, and batches can be zipped.
使用说明与常见问题How-to & FAQ
「PNG 压缩(减色 / 无损优化)」是什么?What is the Compress PNG tool?
在浏览器里压缩 PNG 并保持 PNG 格式:可减少到 2–256 种颜色(调色板 PNG,保留透明,可选抖动),或只做无损优化(逐行选择最佳滤波 + 最高级别压缩)。显示压缩前后大小,比原图还大时自动保留原文件,可批量处理并打包 ZIP。Compress PNGs in your browser and keep them as PNG: reduce to 2–256 colors (palette PNG with transparency, optional dithering) or optimize losslessly (best filter per row plus maximum compression). Before and after sizes are shown, the original is kept when it is already smaller, and batches can be zipped.
如何使用「PNG 压缩(减色 / 无损优化)」?How do I use the Compress PNG tool?
在「PNG 压缩(减色 / 无损优化)」中,选择或拖入文件,按需设置「方式」、「颜色数 2–256」等选项,然后点击「全部下载(ZIP)」按钮即可。In the Compress PNG: Choose or drop your files, set "Method", "Colors 2–256", then click "Download all (ZIP)".
PNG 是怎么被压缩的?How is the PNG compressed?
“减少颜色”把图片量化成最多 N 种颜色(默认 256),写成调色板 PNG(索引色,颜色少于 17 种时用 1/2/4 位存储),透明度写入 tRNS,通常比原来的真彩色 PNG 小 50–80%,和 TinyPNG 等工具的原理相同;颜色量化使用开源 gifenc(MIT)。“无损优化”直接读取 PNG 自身的像素(不经过画布重绘,因此连半透明像素也完全保持原值),只为每一行挑选最佳 PNG 滤波器,再用 zlib 最高级别(9)重新压缩,能去掉多余的元数据,但通常只能小几个百分点;16 位或隔行 PNG 会先规范化为标准 8 位。Reduce colors quantizes the image to at most N colors (256 by default) and writes a palette (indexed) PNG — stored at 1, 2 or 4 bits per pixel when there are 16 or fewer colors — with transparency in tRNS. That is usually 50–80% smaller than the original true-color PNG, the same idea TinyPNG uses; quantization uses the open-source gifenc (MIT). Lossless optimization reads the PNG's own pixels directly (not a re-rendered canvas copy, so even semi-transparent pixels keep their exact values): it picks the best PNG filter for each row and recompresses with zlib at maximum level (9), dropping extra metadata, but usually saves only a few percent. 16-bit or interlaced PNGs are first normalized to standard 8-bit.
会损失画质吗?Will quality suffer?
无损优化完全不会。减少颜色是有损的:图标、截图、插画、文字图在 256 色时几乎看不出区别;照片和大面积渐变可能出现色带,可以勾选“抖动”让渐变更平滑(文件会稍大),或者提高颜色数。照片想要小文件,用 JPG/WebP 通常更合适。Lossless optimization not at all. Reducing colors is lossy: icons, screenshots, illustrations and text images look practically the same at 256 colors, while photos and large gradients may show banding — tick Dithering for smoother gradients (slightly larger files) or raise the color count. For small photo files, JPG or WebP is usually the better format.
为什么有时显示“保留原文件”?Why does it sometimes say the original is kept?
如果原图已经是高度优化的 PNG(或本身颜色很少),重新编码可能反而更大。这时工具不会给你一个更大的文件,而是直接保留原文件并注明。上传的是 JPG 或 WebP 时没有可比的 PNG,结果总是新生成的 PNG。If the original is already a highly optimized PNG (or has very few colors), re-encoding can come out larger. Rather than hand you a bigger file, the tool keeps the original and says so. For JPG or WebP input there is no PNG to compare with, so the result is always the newly made PNG.
透明背景会保留吗?Is transparency kept?
会。减少颜色时透明度和颜色一起量化(16 级),半透明边缘也会保留;无损优化完整保留 Alpha 通道。Yes. When reducing colors, transparency is quantized together with color (16 levels), so soft edges survive; lossless optimization keeps the full alpha channel.
图片会上传吗?Are images uploaded?
不会,解码、量化和 PNG 编码都在你的浏览器中完成,文件不会离开你的设备;EXIF 等元数据会被去除。No. Decoding, quantization and PNG encoding all run in your browser, so files never leave your device; EXIF and other metadata are removed.
「PNG 压缩(减色 / 无损优化)」免费吗?需要注册吗?Is the Compress PNG free? Do I need an account?
「PNG 压缩(减色 / 无损优化)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Compress PNG is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.