🔍

首页Home › 图片工具Image Tools

🔣 图片转 RGB 数值(导出每个像素的颜色值)Convert Image to RGB Values

把图片的每个像素导出为 RGB 数值:可选 CSV(x, y, r, g, b)、JSON 二维数组、HEX 颜色网格、CSS rgb() 或每行一个“r, g, b”,可包含透明度 Alpha,并可先缩放到指定宽度以减少数据量。结果可复制或下载,也能用“RGB 数值转图片”工具原样还原。适合编程练习、LED 点阵、数据分析和机器学习预处理,图片只在浏览器本地处理。Export every pixel of an image as RGB values: CSV (x, y, r, g, b), a JSON 2-D array, a grid of HEX colours, CSS rgb() values or one 'r, g, b' per line, optionally with alpha, and you can scale the image to a smaller width first to cut the amount of data. Copy or download the result, and turn it back into the same image with the RGB Values to Image tool. Handy for coding exercises, LED matrices, data analysis and machine-learning preprocessing. Images are processed locally in your browser.

点击选择或拖放图片Click or drop an image here

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

「图片转 RGB 数值(导出每个像素的颜色值)」是什么?What is the Convert Image to RGB Values tool?

把图片的每个像素导出为 RGB 数值:可选 CSV(x, y, r, g, b)、JSON 二维数组、HEX 颜色网格、CSS rgb() 或每行一个“r, g, b”,可包含透明度 Alpha,并可先缩放到指定宽度以减少数据量。结果可复制或下载,也能用“RGB 数值转图片”工具原样还原。适合编程练习、LED 点阵、数据分析和机器学习预处理,图片只在浏览器本地处理。Export every pixel of an image as RGB values: CSV (x, y, r, g, b), a JSON 2-D array, a grid of HEX colours, CSS rgb() values or one 'r, g, b' per line, optionally with alpha, and you can scale the image to a smaller width first to cut the amount of data. Copy or download the result, and turn it back into the same image with the RGB Values to Image tool. Handy for coding exercises, LED matrices, data analysis and machine-learning preprocessing. Images are processed locally in your browser.

如何使用「图片转 RGB 数值(导出每个像素的颜色值)」?How do I use the Convert Image to RGB Values tool?

在「图片转 RGB 数值(导出每个像素的颜色值)」中,选择或拖入文件,按需设置「格式」、「缩放到宽度(留空 = 原尺寸)」等选项,然后点击「复制」、「下载」按钮即可。In the Convert Image to RGB Values: Choose or drop your files, set "Format", "Resize to width (blank = original)", then click "Copy", "Download".

各种格式是什么样子?What do the formats look like?

CSV 每行一个像素:“x,y,r,g,b”,第一行是表头,适合导入 Excel 或 pandas;“每行一个 r, g, b”按从左到右、从上到下的顺序列出;JSON 是二维数组,外层是行、内层是每个像素的 [r,g,b],可直接在 Python / JavaScript 中使用;HEX 网格每行文字对应图片的一行像素;CSS 输出 rgb() 值。勾选 Alpha 会多一个透明度值(0–255;CSS 中为 0–1)。CSV has one pixel per row as "x,y,r,g,b" with a header line, ready for Excel or pandas. "One r, g, b per line" lists pixels left to right, top to bottom. JSON is a 2-D array, rows outside and each pixel's [r,g,b] inside, usable directly in Python or JavaScript. The HEX grid has one line of text per row of pixels. CSS gives rgb() values. Ticking alpha adds a transparency value (0–255, or 0–1 in CSS).

为什么要缩放?最多能导出多少像素?Why resize, and how many pixels can I export?

每个像素都会生成一行或一段文字,一张 1200 万像素的照片会产生几百 MB 的文本,所以一次最多导出 25 万个像素(约 500×500)。超过时工具会自动填入合适的宽度,你也可以改成需要的尺寸,例如 LED 点阵的 16、32 或 64。Every pixel becomes a line or chunk of text, and a 12-megapixel photo would produce hundreds of MB, so up to 250,000 pixels (about 500×500) can be exported at once. For larger images a suitable width is filled in automatically; change it to what you need, such as 16, 32 or 64 for an LED matrix.

能把数值转回图片吗?会上传吗?Can I turn the values back into an image? Is anything uploaded?

可以,把导出的任何一种格式粘贴到“RGB 数值转图片”工具即可还原(CSV 会按 x、y 坐标定位)。图片只在浏览器本地处理,不会上传。Yes. Paste any of the exported formats into the RGB Values to Image tool to rebuild the picture (CSV is placed by its x and y coordinates). Images are processed locally in your browser and never uploaded.

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

「图片转 RGB 数值(导出每个像素的颜色值)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Convert Image 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 数值转图片(把颜色值画成像素图)Convert RGB Values to Image👾 文字转像素字(像素风文字图片)Convert Text to Pixel Art🟥 颜色可视化(色值列表生成色卡)Visualize Colors (Colour List to Swatches)🌫️ 位图模糊(BMP 高斯模糊 / 方框模糊)Blur a Bitmap (Gaussian & Box Blur)🎨 位图换色(替换 BMP 中的指定颜色)Change Bitmap Colours (Replace a Colour in a BMP)🔁 BGR 位图转 RGB(修正红蓝颠倒的 BMP)Convert BGR Bitmap to RGB Bitmap🌑 位图转灰度(导出 8 位灰度 BMP)Convert Bitmap to Grayscale🖥️ 位图转 VGA 颜色(16 色 / 256 色调色板 BMP)Convert Bitmap to VGA Colours (16 & 256-Colour Palette)🔢 位图转十六进制(BMP 像素 HEX 颜色 / C 数组)Convert Bitmap to Hex🔣 位图转 RGB 数值(BMP 像素颜色值导出)Convert Bitmap to RGB Values🎞️ 动画转位图精灵图(GIF 拆帧拼成 Sprite Sheet)Convert Animation to Bitmap Sprites🔄 RGB 位图转 BGR(交换红蓝通道)Convert RGB Bitmap to BGR Bitmap

← 全部工具All tools