🔍

首页Home › 图片工具Image Tools

🔣 位图转 RGB 数值(BMP 像素颜色值导出)Convert Bitmap to RGB Values

把位图(BMP)每个像素的颜色导出为 RGB 数值:每行一个“r, g, b”、每行一排像素的 (r, g, b) 元组、CSV(x, y, r, g, b)、JSON 二维数组,或按 BMP 文件内部的 B-G-R 顺序输出,可包含透明度(Alpha),并可先缩小到指定宽度以减少数据量。同时显示 BMP 文件头信息(位深、压缩方式、行顺序等)。结果可复制或下载,也能用“RGB 数值转位图”还原。也支持 PNG、JPG 等图片,全部在浏览器本地完成。Export the colour of every pixel of a bitmap (BMP) as RGB values: one "r, g, b" per line, one row of pixels per line as (r, g, b) tuples, CSV (x, y, r, g, b), a JSON 2-D array, or the B-G-R order BMP uses internally, optionally with alpha, and scale the image down to a width first to cut the amount of data. The BMP header (bit depth, compression, row order and more) is shown too. Copy or download the result, and turn it back into an image with RGB Values to Bitmap. PNG, JPG and other images work too; everything runs in your browser.

点击选择或拖放 BMP 位图(也支持 PNG、JPG 等图片)Click or drop a BMP bitmap here (PNG, JPG and other images work too)

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

「位图转 RGB 数值(BMP 像素颜色值导出)」是什么?What is the Convert Bitmap to RGB Values tool?

把位图(BMP)每个像素的颜色导出为 RGB 数值:每行一个“r, g, b”、每行一排像素的 (r, g, b) 元组、CSV(x, y, r, g, b)、JSON 二维数组,或按 BMP 文件内部的 B-G-R 顺序输出,可包含透明度(Alpha),并可先缩小到指定宽度以减少数据量。同时显示 BMP 文件头信息(位深、压缩方式、行顺序等)。结果可复制或下载,也能用“RGB 数值转位图”还原。也支持 PNG、JPG 等图片,全部在浏览器本地完成。Export the colour of every pixel of a bitmap (BMP) as RGB values: one "r, g, b" per line, one row of pixels per line as (r, g, b) tuples, CSV (x, y, r, g, b), a JSON 2-D array, or the B-G-R order BMP uses internally, optionally with alpha, and scale the image down to a width first to cut the amount of data. The BMP header (bit depth, compression, row order and more) is shown too. Copy or download the result, and turn it back into an image with RGB Values to Bitmap. PNG, JPG and other images work too; everything runs in your browser.

如何使用「位图转 RGB 数值(BMP 像素颜色值导出)」?How do I use the Convert Bitmap to RGB Values tool?

在「位图转 RGB 数值(BMP 像素颜色值导出)」中,选择或拖入文件,按需设置「输出格式」、「缩小到宽度(可选)」等选项,然后点击「复制」、「下载 TXT」按钮即可。In the Convert Bitmap to RGB Values: Choose or drop your files, set "Output", "Scale to width (optional)", then click "Copy", "Download TXT".

输出的顺序是怎样的?In what order are the pixels listed?

从左上角开始,先从左到右、再从上到下,和图片看起来的顺序一致(即使 BMP 文件内部是自下而上存储)。CSV 带有 x、y 坐标(从 0 开始);“每行一排像素”和 JSON 二维数组保留了行结构,适合直接在程序里按 [行][列] 读取。From the top-left corner, left to right and then top to bottom, matching how the image looks (even though BMP files store rows bottom-up). CSV includes x and y coordinates starting at 0; One pixel row per line and the JSON 2-D array keep the row structure, so a program can read them as [row][column].

BGR 顺序是什么?What is BGR order?

BMP 文件里每个像素的三个字节依次是蓝、绿、红,Windows 的 GDI 和 OpenCV 也按这个顺序处理颜色。选择“BGR 顺序”时每行输出 b, g, r,方便和这些程序或 BMP 原始数据对照;其他格式都是常用的 r, g, b。Inside a BMP file each pixel's three bytes are blue, green and red, and Windows GDI and OpenCV handle colours in that order too. BGR order prints b, g, r on each line for comparing with those programs or the raw BMP data; every other format uses the usual r, g, b.

数据量太大怎么办?会上传吗?What if there is too much data? Is anything uploaded?

每个像素一行,几百万像素的图片会生成上百 MB 的文本,所以超过 25 万像素时需要先填写“缩小到宽度”,图片会按比例缩小(高质量缩放)后再导出。所有处理都在浏览器本地完成,不会上传。With one line per pixel a multi-megapixel image would produce hundreds of megabytes of text, so above 250,000 pixels you need to fill in Scale to width; the image is scaled down proportionally (high-quality resampling) before export. Everything is processed locally in your browser and nothing is uploaded.

有哪些选项可以调整?What options can I adjust?

「位图转 RGB 数值(BMP 像素颜色值导出)」的设置:「输出格式」可选 每行一个 r, g, b、每行一排像素 (r, g, b)、逗号分隔 CSV(x, y, r, g, b)、JSON 二维数组、BGR 顺序(b, g, r)(默认 每行一个 r, g, b);「缩小到宽度(可选)」可留空;可勾选:「包含透明度」;可选文件:常见图片格式(含 BMP、DIB)。改动任一选项后结果会按新设置重新生成。Settings in the Convert Bitmap to RGB Values — "Output": One r, g, b per line, One pixel row per line, CSV (x, y, r, g, b), JSON 2-D array, BGR order (b, g, r) (default One r, g, b per line); "Scale to width (optional)" optional; tick boxes: "Include alpha"; files: common image formats (including BMP, DIB). Changing any option regenerates the result with the new setting.

「位图转 RGB 数值(BMP 像素颜色值导出)」免费吗?需要注册吗?Is the Convert Bitmap to RGB Values free? Do I need an account?

「位图转 RGB 数值(BMP 像素颜色值导出)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Convert Bitmap to RGB Values 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

🖌️ RGB 数值转位图(把颜色值画成 BMP)Convert RGB Values to Bitmap🔣 图片转 RGB 数值(导出每个像素的颜色值)Convert Image to RGB Values🔢 位图转十六进制(BMP 像素 HEX 颜色 / C 数组)Convert Bitmap to Hex🎞️ 动画转位图精灵图(GIF 拆帧拼成 Sprite Sheet)Convert Animation to Bitmap Sprites🔄 RGB 位图转 BGR(交换红蓝通道)Convert RGB Bitmap to BGR Bitmap✂️ 位图裁剪(按像素或百分比裁剪 BMP)Crop a Bitmap↔️ 位图水平翻转(左右镜像 BMP)Flip a Bitmap Horizontally↕️ 位图垂直翻转(上下颠倒 BMP)Flip a Bitmap Vertically🌗 位图反色(BMP 负片效果)Invert Bitmap Colours🎚️ 位图减色(减少 BMP 颜色数 / 索引色)Reduce Bitmap Colours🔲 去除位图边框(自动裁掉 BMP 四周的纯色边)Remove a Bitmap Border📐 位图缩放(调整 BMP 尺寸)Resize a Bitmap

← 全部工具All tools