🧱 字节转图片(Hex / Base64 / 原始像素还原图片)Create Image from Bytes (Hex, Base64, Raw Pixels)
把一串字节还原成图片:支持十六进制(含 0x、\x、C 数组和 hexdump 格式)、十进制、二进制、Base64 和 Data URI,可自动识别输入格式;字节如果是图片文件(PNG、JPEG、GIF、WebP、BMP、ICO、AVIF、SVG)就直接显示并下载原文件,如果是原始像素数据(RGB、RGBA、BGRA、灰度),填写宽度即可生成 PNG。适合调试固件、抓包数据和代码里内嵌的图片,全程在浏览器本地完成。Rebuild an image from a string of bytes. Hex (including 0x, \x, C arrays and hexdump output), decimal, binary, Base64 and Data URIs all work, and the input format is detected automatically. If the bytes are an image file (PNG, JPEG, GIF, WebP, BMP, ICO, AVIF, SVG) it is shown and you can download the original file; if they are raw pixels (RGB, RGBA, BGRA or greyscale), enter the width to get a PNG. Handy for debugging firmware, captured packets and images embedded in code. Everything runs locally in your browser.
使用说明与常见问题How-to & FAQ
「字节转图片(Hex / Base64 / 原始像素还原图片)」是什么?What is the Create Image from Bytes (Hex, Base64, Raw Pixels) tool?
把一串字节还原成图片:支持十六进制(含 0x、\x、C 数组和 hexdump 格式)、十进制、二进制、Base64 和 Data URI,可自动识别输入格式;字节如果是图片文件(PNG、JPEG、GIF、WebP、BMP、ICO、AVIF、SVG)就直接显示并下载原文件,如果是原始像素数据(RGB、RGBA、BGRA、灰度),填写宽度即可生成 PNG。适合调试固件、抓包数据和代码里内嵌的图片,全程在浏览器本地完成。Rebuild an image from a string of bytes. Hex (including 0x, \x, C arrays and hexdump output), decimal, binary, Base64 and Data URIs all work, and the input format is detected automatically. If the bytes are an image file (PNG, JPEG, GIF, WebP, BMP, ICO, AVIF, SVG) it is shown and you can download the original file; if they are raw pixels (RGB, RGBA, BGRA or greyscale), enter the width to get a PNG. Handy for debugging firmware, captured packets and images embedded in code. Everything runs locally in your browser.
如何使用「字节转图片(Hex / Base64 / 原始像素还原图片)」?How do I use the Create Image from Bytes (Hex, Base64, Raw Pixels) tool?
在「字节转图片(Hex / Base64 / 原始像素还原图片)」中,按需设置「输入格式」、「数据类型」、「像素格式」、「宽度」等选项,然后点击「下载图片」按钮即可。In the Create Image from Bytes (Hex, Base64, Raw Pixels): Set "Input format", "Data type", "Pixel format", "Width", then click "Download image".
支持哪些输入格式?Which input formats are supported?
十六进制(“89 50 4E 47”、“89504E47”、“0x89, 0x50”、“\x89\x50”、C / JS 数组,以及 hexdump / xxd 输出)、十进制(“137, 80, 78”)、二进制(“10001001 01010000”)、Base64 和 data:image/…;base64, 开头的 Data URI。“自动识别”会根据内容判断;纯数字且用空格分隔时可能有歧义(如“10 20 30”既可能是十六进制也可能是十进制),这时请手动选择格式。Hex ("89 50 4E 47", "89504E47", "0x89, 0x50", "\x89\x50", C or JS arrays, and hexdump / xxd output), decimal ("137, 80, 78"), binary ("10001001 01010000"), Base64, and Data URIs starting with data:image/…;base64,. Auto-detect works it out from the content. Space-separated plain numbers can be ambiguous ("10 20 30" could be hex or decimal), so pick the format manually then.
“图片文件”和“原始像素”有什么区别?What's the difference between Image file and Raw pixels?
图片文件是完整的 PNG、JPEG 等文件字节(有文件头、压缩数据),工具直接识别格式并显示,下载得到的就是原始文件。原始像素是没有任何文件头、按顺序排列的像素值(例如摄像头、显示屏驱动或 OpenCV 里的缓冲区),需要告诉工具像素格式(RGB、RGBA、BGRA 或灰度)和宽度,高度会自动计算,结果导出为 PNG。An image file is the full bytes of a PNG, JPEG and so on (with a header and compressed data); the tool recognises the format, shows it, and the download is that original file. Raw pixels are plain pixel values in order with no header, like a camera, display-driver or OpenCV buffer. Tell the tool the pixel format (RGB, RGBA, BGRA or greyscale) and the width; the height is worked out automatically and the result is exported as PNG.
提示“不能排成完整的行”怎么办?What if it says the pixels don't make whole rows?
原始像素的总数必须是宽度的整数倍。提示里会列出能整除的宽度;如果都不合理,通常是像素格式选错了(例如数据其实是 RGBA 却选了 RGB),或者数据开头带有额外的文件头,需要先删掉。The total number of raw pixels has to be a whole multiple of the width. The message lists widths that divide evenly. If none of them make sense, the pixel format is usually wrong (RGBA data read as RGB, say), or there's an extra header at the start of the data that needs removing first.
数据会上传吗?Is my data uploaded?
不会,所有解析和生成都在浏览器本地完成。No. All parsing and image building happens locally in your browser.
「字节转图片(Hex / Base64 / 原始像素还原图片)」免费吗?需要注册吗?Is the Create Image from Bytes (Hex, Base64, Raw Pixels) free? Do I need an account?
「字节转图片(Hex / Base64 / 原始像素还原图片)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Create Image from Bytes (Hex, Base64, Raw Pixels) is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.