Pixel Diff for VS CodeCompare two images side-by-side with synced zooming and panning, pixel-level diff highlighting, and a slider wipe mode. Supports all image formats shown by the VS Code built-in image viewer: PNG, JPEG, BMP, GIF, ICO, WebP, and AVIF. FeaturesOpening the Diff ViewerThere are four ways to open Pixel Diff, depending on where you are: Command PaletteOpen the Command Palette ( Explorer context menuRight-click any supported image file in the Explorer panel:
Editor title barOpen an image file in VS Code. Two diff icons appear in the editor title bar:
SCM panel
By default, clicking any image in the Source Control panel opens Pixel Diff instead of VS Code's built-in diff editor, which cannot display binary image files properly. The HEAD version is shown on the left and the working copy on the right.
To disable automatic interception and fall back to the default behaviour, set You can also right-click any changed image and choose Pixel Diff: Compare with Git HEAD directly from the context menu. Layout ModesSwitch between layouts using the dropdown in the top-left of the toolbar. Your choice applies immediately — no need to reload. Side by SideBoth images are displayed next to each other with a divider between them. When the panel is too narrow to fit both, they stack automatically.
StackedBoth images are shown one above the other. Useful when comparing tall images or when you want a full-width view of each.
Overlay (Diff)Image A is shown with diff pixels drawn on top according to the active diff mode (binary or heatmap). The checkerboard pattern in transparent areas indicates pixels that were removed or are fully transparent.
See Diff Modes below for how the overlay is rendered. Slider WipeA draggable handle divides the canvas: image A is shown on the left and image B on the right. Drag the handle to slide the reveal point. The label at the top of each side identifies which image is which.
Diff ModesDiff modes only apply when the layout is Overlay (Diff). Switch between them using the second dropdown in the toolbar. BinaryEach pixel in image B that differs from image A by more than the sensitivity threshold is painted in the chosen highlight color (default: red). Pixels within the threshold are left unchanged.
HeatmapEach changed pixel is colored on a spectrum from blue (small difference) through green and yellow to red (large difference). Opacity is proportional to the magnitude of the change, so subtle differences are semi-transparent and large differences are fully opaque. No color picker or sensitivity slider is shown in heatmap mode — the coloring is computed automatically.
No differences detected — when the images are identical, the overlay canvas is fully transparent and you'll see only the checkerboard:
Zoom & PanAll layouts support synchronized zoom and pan:
Both images always stay in sync: zooming or panning one side moves the other by the same amount. Supported Image FormatsPNG, JPEG/JPG, BMP, GIF, ICO, WebP, AVIF Settings
DevelopmentPrerequisites
Setup
Run the extension locallyPress F5 in VS Code to open a new Extension Development Host window with the extension loaded. TestingThe project has two test suites. Run both when validating changes. Unit & integration tests (Mocha + vscode-test)These tests run inside a real VS Code instance via
Test files live in Visual regression tests (Playwright)Playwright tests open the webview HTML in headless Chromium and compare screenshots against committed baselines.
After intentional UI changes, update the baseline snapshots:
Test specs live in Testing during development
Package for local install
Architecture
LicenseMIT — see LICENSE. Author |





