RAW Image Viewer
Inspect headerless RAW, YUV and ordinary images inside VS Code: check the data layout, read sample values, and compare two frames at the same pixel.

Everything happens on your machine. The extension reads files through the VS Code file system API and never uploads anything.
Why
Camera, ISP and image-signal work constantly runs into files with no header: a sensor dump, a MIPI capture, a YUV sequence. The only way to know whether a frame is really what the pipeline claims is to look at the bytes and the samples they decode to. This extension opens those files directly in the editor you already have open.
Features
- Headerless RAW: mono and Bayer (RGGB, BGGR, GRBG, GBRG)
- Bit depths 8 / 10 / 12 / 14 / 16, in an 8-bit container, a 16-bit container (either byte order), or MIPI RAW10 / RAW12 / RAW14 packing
- YUV: 4:4:4, 4:2:2 and 4:2:0, planar, semi-planar and packed byte orders (I420, YV12, NV12, NV21, YUYV, UYVY, YVYU, VYUY, YUV, YVU, UYV, VUY), BT.601 or BT.709, limited or full range
- Ordinary images: PNG, JPEG, BMP, GIF, WebP, AVIF
- Parameter inference: width, height, bit depth, CFA phase and packing are read from the file name when it contains them, and cross-checked against the file size
- Byte-layout diagram: a bit grid showing exactly which byte carries which pixel bit, including MIPI packing and padding
- Pixel readout: hover to read any sample, click to lock it and see the bytes behind it
- Display controls: levels with automatic range detection, exposure, gamma, white balance, four false-colour palettes, demosaicing modes, over/under-exposure highlighting
- Comparison: open a second frame beside the first, either fitted independently or locked to the same position and zoom; or stack the two in one stage as a difference blend or a blink
- File sequence: the folder of the open file is listed; arrow keys walk it, and a frame written to on disk reloads in place
- Per-file settings: each file keeps its own levels, exposure, gamma and white balance, so a sequence of mixed formats does not carry one frame's display settings onto the next
- PNG export: write the current frame at its own resolution with the display settings applied, ready for a report
- English and Chinese, following the editor's display language
Supported file names
Parameters are inferred from the name and confirmed against the file size, so these all open with the right settings:
3840x2160_14_RGGB.raw
w2688_h1520_10bit_RGGB.raw
w2688_h1520_16bit_10msb_RGGB_02.raw
Crop_1024x576_MIPI12_RGGB.raw
frame_1920x1080_nv12.yuv
A name with no usable size falls back to the resolution that best accounts for the byte count.
Usage
- Double-click a
.raw, .bin or YUV file in the explorer, or right-click → Open with RAW Image Viewer.
- Adjust the read parameters in the panel if the inference is wrong; the byte count tells you whether the settings can be right.
- Use View the layout to confirm a packed format bit by bit.
- Press Compare to open a second frame, and Inspect to hide the panel for a larger view.
Keyboard and mouse
| Input |
Action |
↑ ↓ ← →, PgUp PgDn |
Previous / next file in the sequence |
F, Enter |
Fit the image to the window |
| Drag |
Pan |
| Wheel |
Zoom at the pointer |
| Double-click |
Toggle between fit and 1:1 |
| Click |
Lock the pixel under the pointer |
Settings
| Setting |
Default |
Meaning |
raw-image-viewer.enableBinSupport |
true |
Open .bin files with the viewer. When off, .bin keeps its previous editor and VS Code asks for a window reload. |
Notes
- Files are opened read-only; the extension never writes to them. The PNG export is the one exception, and it only writes where you point it.
- Very large frames are limited by the GPU texture size; the panel reports the limit instead of failing silently.
- YUV files are treated as 8-bit planes, which is what 4:4:4, 4:2:2 and 4:2:0 captures in this viewer are expected to be.
Development
npm install
npm ci --prefix webview
npm run build # extension + webview
npm run test # compile, lint, unit tests
Press F5 in VS Code to launch an Extension Development Host, then open a file from examples/.
Project layout
src/
├── extension/ activation, custom editor provider, document model
├── shared/ types and constants shared by host and webview
└── test/ unit, integration and VS Code end-to-end tests
webview/
├── src/
│ ├── core/ format inference, layout maths, sample readers
│ ├── engine/ WebGL2 renderer and shaders
│ ├── ui/ file list, viewer, inspection panel
│ ├── i18n.ts message table (English and Chinese)
│ └── vscode.ts host bridge
└── e2e/ Playwright suites driving the built bundle
The webview is a plain web app whose only host dependency is acquireVsCodeApi(), so the same bundle runs in a browser and in the editor.
Testing
| Layer |
Command |
Covers |
| Unit |
npm run test:unit |
Host-side logic |
| Webview E2E |
npm run test:e2e:webview |
Boot, file sequence, comparison, language, format checks |
| VS Code E2E |
npm run test:e2e:vscode |
A real VS Code window and the custom editor |
| Integration |
npm run test:integration |
Activation, commands, document loading |
中文说明
在 VS Code 里检查无文件头的 RAW、YUV 和普通图片:核对数据排布、读取采样值,并在同一坐标对照两幅图像。所有文件都在本机读取,不会上传。
支持单通道与拜耳阵列(RGGB / BGGR / GRBG / GBRG)、8/10/12/14/16 位、8 位与 16 位容器及 MIPI RAW10/12/14 打包、12 种 YUV 排布、以及常见的普通图片格式。文件名里的宽高、位深、相位和打包信息会被自动识别,并与文件大小相互校验。
在资源管理器中双击 .raw 文件即可打开;左侧是同目录的图像序列,右侧是读取参数与显示设置,画布下方显示像素读数。对比按钮可以并排打开第二幅图,检查按钮隐藏参数栏。
界面语言跟随 VS Code 的显示语言,中文环境自动使用中文。
License
MIT
| |