RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • gray2rgb
    • hsv2rgb
    • im2double
    • im2uint16
    • im2uint8
    • ind2rgb
    • lab2rgb
    • rgb2gray
    • rgb2hsv
    • rgb2lab

lab2rgb — Convert CIE L*a*b* values to sRGB using MATLAB-compatible D65 conversion defaults.

lab2rgb(LAB) converts single or double L*a*b* image or colormap data to sRGB values under D65 assumptions. OutputType selects double, single, uint8, or uint16 output.

Syntax

RGB = lab2rgb(LAB, OutputType=type)

Inputs

NameTypeRequiredDefaultDescription
LABAnyYes—CIE L*a*b* image or Nx3 colormap values.
nameStringScalarVariadic—OutputType name.
valueStringScalarVariadic—double, single, uint8, or uint16 output class.

Returns

NameTypeDescription
RGBNumericArraysRGB image or colormap converted from CIE L*a*b* input.

Errors

IdentifierWhenMessage
RunMat:lab2rgb:TooManyInputsToo many name-value arguments are supplied.lab2rgb: too many input arguments
RunMat:lab2rgb:InvalidInputInput cannot be interpreted as an MxNx3 L*a*b* image or Nx3 colormap.lab2rgb: invalid input
RunMat:lab2rgb:InternalRGB output tensor construction fails internally.lab2rgb: internal conversion failure
RunMat:lab2rgb:InvalidOptionOutputType is malformed or unsupported.lab2rgb: invalid option

How lab2rgb works

  • Accepts MxNx3 Lab images and Nx3 Lab colormaps.
  • Floating output preserves out-of-gamut RGB values; uint8 and uint16 output clips to [0,1] while converting to native integer storage.
  • The OutputType name-value option accepts double, single, uint8, or uint16.

Example

Lab To RGB

RGB = lab2rgb(LAB);

Expected output:

% RGB has red, green, and blue channels

Using lab2rgb with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how lab2rgb changes the result.

Run a small lab2rgb example, explain the result, then change one input and compare the output.

Related Image functions

Color

gray2rgb · hsv2rgb · im2double · im2uint16 · im2uint8 · ind2rgb · rgb2gray · rgb2hsv · rgb2lab

Filters

filter2 · fspecial · imfilter

Image

imfinfo · imhist

Io

imread · imwrite

Open-source implementation

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

  • View the source for lab2rgb in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How lab2rgb works
  • Example
  • Lab To RGB
  • Using lab2rgb with coding agents
  • Related Image functions
  • Color
  • Filters
  • Image
  • Io
  • Open-source implementation
  • About RunMat