All-color PNG Generator

Builds a broad color-spectrum PNG where hue sweeps across the x-axis (0-360 degrees) and lightness sweeps down the y-axis (0-100%), at a fixed 100% saturation. It's a continuous spectrum sweep for reference or visual use, not a literal one-pixel-per-unique-RGB-value image. Generated entirely in your browser. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool generates a broad color-spectrum PNG, sweeping hue across one axis and lightness across the other, entirely in your browser.

It's a quick way to visualize the full range of hues at every brightness level, at a glance, in a single image.

What Is All-color PNG Generator?

A 2D color-spectrum generator that computes an HSL color for every pixel position, converts it to RGB, and writes the result into a pixel buffer.

Honestly named for what it visually represents (a sweep across the color wheel) rather than for literal pixel-exact RGB coverage; producing every one of the 16,777,216 possible 24-bit RGB colors would require a fixed 4096x4096 canvas, which this tool does not attempt.

How All-color PNG Generator Works

For each pixel at position (x, y), hue is computed as (x / width) * 360 degrees, lightness as (y / height) * 100 percent, and saturation is held fixed at 100%.

That HSL triple is converted to RGB using the standard sector-based HSL-to-RGB formula, then written into the pixel buffer at full opacity.

When To Use All-color PNG Generator

Use it to generate a quick visual reference for the HSL color space, a colorful background/banner image, or a gradient texture for design mockups.

It's also a handy visual sanity check for anything working with hue and lightness math, since the whole sweep is visible in one image.

Features

Advantages

  • Produces a smooth, continuous, mathematically precise color sweep with no banding beyond the resolution of the output image.
  • Fully deterministic and reproducible: the same width and height always produce the exact same gradient.
  • Runs entirely client-side with no server round-trip or upload.

Limitations

  • Only sweeps two of the three HSL dimensions (hue and lightness); saturation is fixed at 100% and can't be swept simultaneously in a single 2D image.
  • Despite the name, this is not a literal one-pixel-per-unique-RGB-value image; it's a continuous hue x lightness spectrum sweep, which is a deliberate design choice, not an attempt at exhaustive RGB coverage.

Examples

Default spectrum sweep

Input

width=360, height=180 (default)

Output

A 360x180 PNG with one pixel per degree of hue across the top-to-bottom lightness gradient

The default width matches the 360 degrees in a full hue rotation for a clean 1:1 mapping.

Wide banner sweep

Input

width=1200, height=120

Output

A 1200x120 PNG stretching the same hue x lightness sweep across a wider banner shape

Any width/height combination re-samples the same underlying hue and lightness formulas to the new pixel grid.

Best Practices & Notes

Best Practices

  • Use the default 360-pixel width when you want each hue degree mapped to exactly one pixel column.
  • Increase the height for a smoother, more gradual lightness gradient from black to white.

Developer Notes

generateAllColorPng is a pure function with a locally-defined hslToRgb helper (standard sector-based conversion, no DOM dependency); it deliberately favors an honest 2D hue x lightness sweep over an infeasible literal 3D RGB-cube rendering, and the content copy is upfront about that tradeoff rather than implying exhaustive color coverage.

All-color PNG Generator Use Cases

  • Generating a reference image for the HSL color space
  • Creating a colorful gradient background or banner texture
  • Visually spot-checking hue/lightness math in a design tool

Common Mistakes

  • Assuming the output literally contains all 16.7 million possible RGB colors — it's a 2D hue x lightness sweep at fixed saturation, not a 3D RGB cube rendering.
  • Expecting saturation to vary across the image; it's intentionally held constant at 100% in this tool.

Tips

  • Use a square-ish aspect ratio if you want the hue and lightness gradients to feel visually balanced.
  • Sample a specific pixel's color from the output to quickly look up the RGB value for a given hue/lightness combination.

References

Frequently Asked Questions