EIT easy-image-tools / Build an image from rgba values

Build an image from rgba values

Assembles an image from rgba(r, g, b, a) numbers. Set the width — height is computed automatically.

Nothing found — try another word.

01

Build an image from rgba values

Nothing found — try another word.

Width

Nothing found — try another word.

Preview
Source
Result
no result yet

Build an image from rgba values takes a run of numbers in the CSS spelling of a color — rgba(255, 0, 0, 255) and its neighbours — and assembles them back into a picture. Paste the values into the text field, set Width to the number of pixels in one row, and the height follows from the total; a 32 by 32 icon is 256 rgba groups at a width of 32. Commas, parentheses and line breaks are ignored, so a list copied out of a stylesheet works as it is, but the values are not negotiable: each must be a whole number from 0 to 255, four per pixel, and the pixel count must divide evenly by the width. A wrong width is the one mistake the page cannot detect — it assembles a sheared picture without complaining.

  • Assembled entirely in your browser: no upload, no server, no signup.
  • Only the numbers are read — punctuation and spacing are ignored.
  • Alpha is a byte from 0 to 255; multiply a CSS 0.5 by 255 before pasting.
  • A partial row stops the page with an error naming both numbers.
  • The PNG to RGB values tool prints this exact notation for a round trip.
  • Free with no daily limit, no watermark and no account, also for commercial use.

How to use it

  1. Paste the rgba(255, 0, 0, 255) style values into the text field; the punctuation is ignored.
  2. Set Width to the pixel count of a single row - divide the value count by four to get the pixel count, then check that it divides evenly.
  3. Compare the preview with the shape you expect and change the width if rows are offset.
  4. Download the assembled PNG from the Download button.

Questions

Do the parentheses and commas have to be exact?

No, only the numbers are read. Spacing, commas, parentheses and line breaks are ignored, so a stylesheet rule pastes fine.

Why does an error appear when the numbers do not fit?

A partial row has no sensible answer, so a remainder is reported with both numbers rather than padded away.

Can alpha be a fraction?

No. Every channel is a byte between 0 and 255, and fractions are rejected. Multiply a CSS alpha such as 0.5 by 255 before pasting.

Where do I get this format?

From an image: the PNG to RGB values tool prints every pixel in this exact notation, one image row per line, an exact round trip in pixel values.

Related tools