🔍

首页Home › 图片工具Image Tools

🎚️ 位图减色(减少 BMP 颜色数 / 索引色)Reduce Bitmap Colours

把位图(BMP)或其他图片的颜色减少到指定数量(2–256 种):用中位切分算法根据图片本身挑选最有代表性的颜色,可选 Floyd–Steinberg 抖动让渐变更自然。导出 BMP 时生成真正的索引色位图——2 色为 1 位、16 色以内为 4 位、256 色以内为 8 位,文件比 24 位 BMP 小得多,适合老式设备、单片机屏幕和像素画。图片本来颜色就不多时会原样保留全部颜色。也可以导出 PNG,支持批量,只在浏览器本地处理。Reduce a bitmap (BMP) or any other image to a set number of colours (2–256). The median-cut algorithm picks the most representative colours from the image itself, and optional Floyd–Steinberg dithering keeps gradients smooth. BMP output is a true indexed bitmap — 1-bit for 2 colours, 4-bit for up to 16 and 8-bit for up to 256 — much smaller than a 24-bit BMP, ideal for old devices, microcontroller screens and pixel art. An image that already has few enough colours keeps every one exactly. PNG is also available; works in bulk, locally in your browser.

点击选择或拖放图片(可多选)Click or drop images here (multiple allowed)

使用说明与常见问题How-to & FAQ

「位图减色(减少 BMP 颜色数 / 索引色)」是什么?What is the Reduce Bitmap Colours tool?

把位图(BMP)或其他图片的颜色减少到指定数量(2–256 种):用中位切分算法根据图片本身挑选最有代表性的颜色,可选 Floyd–Steinberg 抖动让渐变更自然。导出 BMP 时生成真正的索引色位图——2 色为 1 位、16 色以内为 4 位、256 色以内为 8 位,文件比 24 位 BMP 小得多,适合老式设备、单片机屏幕和像素画。图片本来颜色就不多时会原样保留全部颜色。也可以导出 PNG,支持批量,只在浏览器本地处理。Reduce a bitmap (BMP) or any other image to a set number of colours (2–256). The median-cut algorithm picks the most representative colours from the image itself, and optional Floyd–Steinberg dithering keeps gradients smooth. BMP output is a true indexed bitmap — 1-bit for 2 colours, 4-bit for up to 16 and 8-bit for up to 256 — much smaller than a 24-bit BMP, ideal for old devices, microcontroller screens and pixel art. An image that already has few enough colours keeps every one exactly. PNG is also available; works in bulk, locally in your browser.

如何使用「位图减色(减少 BMP 颜色数 / 索引色)」?How do I use the Reduce Bitmap Colours tool?

在「位图减色(减少 BMP 颜色数 / 索引色)」中,选择或拖入文件,按需设置「颜色数」、「抖动」、「输出格式」等选项,然后点击每个结果旁的「下载」按钮即可;有多个文件时也可以点「全部下载(ZIP)」一次打包下载。In the Reduce Bitmap Colours: Choose or drop your files, set "Colours", "Dithering", "Format", then click the Download button next to each result (with several files, "Download all (ZIP)" saves them together).

颜色是怎么挑选的?How are the colours chosen?

工具用中位切分(Median Cut)算法:先统计图片里所有颜色和它们出现的次数,然后不断把颜色范围最大、像素最多的一组颜色从中间切开,直到分成指定数量的组,每组取加权平均色。所以调色板是根据这张图片“量身定做”的,比固定调色板更接近原图。图片本来的颜色数不超过设定值时,会原样保留所有颜色,不做任何近似。The tool uses median cut: it counts every colour in the image and how often it appears, then keeps splitting the group with the widest colour range and the most pixels at its middle until there are as many groups as colours requested, taking each group's weighted average. The palette is therefore tailored to this image and closer to the original than a fixed palette. If the image already has no more colours than requested, every colour is kept exactly with no approximation.

导出的 BMP 是几位的?What bit depth is the BMP?

根据最终颜色数自动选择:2 色导出 1 位 BMP(每个字节存 8 个像素),3–16 色导出 4 位,17–256 色导出 8 位,调色板写在文件里。例如 100×100 的图片,24 位 BMP 约 30 KB,16 色 4 位 BMP 只有约 5 KB。BMP 不支持透明,透明部分会填成白色。It is chosen from the final number of colours: 2 colours give a 1-bit BMP (8 pixels per byte), 3–16 colours 4-bit and 17–256 colours 8-bit, with the palette stored in the file. A 100×100 image is about 30 KB as a 24-bit BMP but only about 5 KB as a 16-colour 4-bit BMP. BMP has no transparency, so transparent areas are filled with white.

要不要开抖动?Should I use dithering?

颜色很少时,照片和渐变不抖动会出现明显的色带;Floyd–Steinberg 抖动把误差分散到相邻像素,用交错的点模拟中间色,看起来更平滑,但文件压缩率会稍差。图标、像素画、文字截图通常不抖动更清晰。With few colours, photos and gradients show visible bands without dithering. Floyd–Steinberg spreads the error to neighbouring pixels, imitating in-between colours with a pattern of dots for a smoother look, at the cost of slightly worse compression. Icons, pixel art and text screenshots usually look crisper without it.

大图会卡住吗?Can a large image freeze the tab?

会。中位切分要遍历全部像素并多次切分色盒;超过约 800 万像素(常见于二十多 MB 的未压缩 BMP)时本工具会直接拒绝,请先用“调整位图大小”等比缩小后再减色。Yes. Median-cut walks every pixel and splits colour boxes many times; above about 8 megapixels (common for 20+ MB uncompressed BMPs) this tool refuses the file — resize proportionally first (e.g. Resize a Bitmap), then reduce colours.

支持哪些图片?会上传吗?Which images work, and are they uploaded?

支持 JPG、PNG、WebP、GIF(静态或动图的第一帧)、BMP、AVIF、HEIC,以及浏览器能打开的 SVG;可一次拖入最多 50 张批量处理,单张最大 60 MB、1 亿像素;多张结果可打包成 ZIP 下载。所有处理都在你的浏览器里完成,图片不会上传,结果中也不会保留 EXIF 等元数据(包括拍摄位置)。JPG, PNG, WebP, GIF (a still or the first frame of an animation), BMP, AVIF, HEIC, and SVG that the browser can open. Drop in up to 50 images at once; each can be up to 60 MB and 100 megapixels, and several results can be downloaded as a ZIP. Everything happens in your browser: images are not uploaded, and EXIF and other metadata (including location) is not kept in the results.

「位图减色(减少 BMP 颜色数 / 索引色)」免费吗?需要注册吗?Is the Reduce Bitmap Colours free? Do I need an account?

「位图减色(减少 BMP 颜色数 / 索引色)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Reduce Bitmap Colours is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

🖥️ 位图转 VGA 颜色(16 色 / 256 色调色板 BMP)Convert Bitmap to VGA Colours (16 & 256-Colour Palette)🖍️ 图片颜色简化(减少颜色数)Simplify Image Colors (Reduce Colors)🎨 提取位图调色板(BMP 主色 / 色值列表)Extract a Bitmap Colour Palette🔲 去除位图边框(自动裁掉 BMP 四周的纯色边)Remove a Bitmap Border📐 位图缩放(调整 BMP 尺寸)Resize a Bitmap🔃 位图旋转(BMP 旋转 90° / 180° / 任意角度)Rotate a Bitmap🧪 位图分色(拆分 BMP 的红、绿、蓝通道)Separate Bitmap Colours✨ 位图锐化(BMP 反锐化掩模 / 拉普拉斯)Sharpen a Bitmap🔠 十六进制转位图(HEX / C 数组 → BMP)Convert Hex to Bitmap🖌️ RGB 数值转位图(把颜色值画成 BMP)Convert RGB Values to Bitmap🔤 符号转位图(ASCII / Braille 画 → BMP)Convert Symbols to a Bitmap🎲 随机位图生成器(噪点 / 色块 BMP)Draw a Random BMP

← 全部工具All tools