RunMat
GitHub

imshow — Display grayscale, binary, truecolor, or file-backed images.

imshow displays image data using MATLAB-familiar defaults. Numeric and logical 2-D arrays render as grayscale images, MxNx3 and MxNx4 arrays render as truecolor images, and filename inputs are decoded through RunMat's filesystem layer before display.

How imshow works

  • imshow(I) displays 2-D numeric data with grayscale limits [0, 1], matching MATLAB double-image defaults.
  • imshow(BW) displays logical image data as black and white using [0, 1] limits.
  • imshow(RGB) displays MxNx3 truecolor data directly.
  • imshow(RGBA) displays MxNx4 truecolor data with alpha.
  • imshow(I, [low high]) displays grayscale image data using an explicit display range.
  • imshow(I, []) auto-scales grayscale image data from finite minimum to finite maximum.
  • imshow(filename) reads and decodes an image file, then displays it as truecolor data.

Examples

Display a simple grayscale image

row = 100;
col = 100;
rsm = ones(row, col);
imshow(rsm);

Auto-scale a matrix for display

A = peaks(128);
imshow(A, []);

Display truecolor RGB data

R = ones(64, 64);
G = zeros(64, 64);
B = zeros(64, 64);
RGB = cat(3, R, G, B);
imshow(RGB);

Display an image file

imshow("photo.png");

FAQ

What display range does imshow use for doubles?

imshow(I) uses [0, 1] for floating-point grayscale data. Use imshow(I, []) when you want RunMat to scale the visible range from the data minimum to maximum.

Does imshow support uint8 and uint16 image defaults?

File-backed images decode with byte pixel semantics. User-created integer image arrays currently depend on RunMat's broader numeric-class metadata model, so exact MATLAB class-dependent defaults for dense uint8/uint16 tensors are tracked separately.

How is imshow different from imagesc?

imshow is for image display and uses grayscale or truecolor image defaults. imagesc is for scaled matrix visualization and maps data through the active colormap.

2D Charts

area · bar · errorbar · hist · histogram · loglog · pie · plot · scatter · semilogx · semilogy · stairs · stem

3D & Surface

contour · contourf · mesh · meshc · plot3 · quiver · scatter3 · surf · surfc

Images

image · imagesc

Axes & Layout

axis · box · grid · sgtitle · subplot · view · zlabel

Appearance

colorbar · colormap · legend · shading

Handle Access

get · set

Other

cla · clf · figure · gca · gcf · hold · title

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how imshow works, line by line, in Rust.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code — faster, on any GPU, with no license required.

  • Simulations that took hours now take minutes. RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed.
  • Start running code in seconds. Open the browser sandbox or download a single binary. No license server, no IT ticket, no setup.
  • A full development environment. GPU-accelerated 2D and 3D plotting, automatic versioning on every save, and a browser IDE you can share with a link.

Getting started · Benchmarks · Pricing

Try RunMat for free

Open the sandbox and start running MATLAB code in seconds. No account required.