PNG to RGB Converter for Raw Pixel Data

Writes your PNG as a headerless file of 8-bit red, green and blue samples.

or drop files here

PN

PNG Format

Portable Network Graphics

A lossless raster format that stores its own width and height and can carry transparency.

  • Lossless DEFLATE compression
  • 1 to 16 bits per sample
  • Optional alpha channel
RG

RGB Format

Raw RGB image data

Interleaved 8-bit red, green and blue samples with no header.

  • No header
  • 8 bits per sample
  • Width and height needed to read

How to convert PNG to RGB

Follow these steps to convert PNG to RGB online.

    1

    Choose your PNG file, or several at once.

    2

    Wait while the converter turns each file into RGB.

    3

    Download each new RGB file. Your original file isn't changed.

Before converting PNG to RGB

  • The .rgb file is headerless: it needs the PNG's width and height to be read again.
  • Each pixel becomes three 8-bit samples, so transparency, 16-bit depth and metadata are not kept.
  • An SGI image shares the .rgb ending but is a different layout, written by the SGI method below.

About PNG and RGB

What is a PNG file?

PNG, or Portable Network Graphics, was created as a patent-free successor to GIF. Its 1996 specification was the first W3C Recommendation for a graphics format; the standards RFC 2083 and ISO/IEC 15948:2004 came after. Its compression is always lossless DEFLATE. Color can be stored as a palette index, as gray, or as full truecolor, with sample depths from one bit up to sixteen, plus an optional alpha channel. macOS saves screenshots as PNG, and every major browser displays it.

Every PNG opens with the same signature bytes and is made of chunks, and IHDR is the header chunk. A raw .rgb file has nothing like it.

Programs that open PNG files

  • Windows, Mac and Linux: GIMP opens PNG for editing, and ImageMagick reads it as well.
  • Web: Chrome and Firefox display PNG.
  • Mobile: Safari and Chrome show PNG pictures.

PNG and RGB compared

  • Header: a PNG carries its own dimensions; the .rgb file this page writes carries none, so its width and height must be supplied when it is read.
  • Samples: a PNG may hold 1 to 16 bits per sample and an alpha channel. The RGB file has three interleaved 8-bit samples per pixel.
  • Same ending, different file: an .rgb ending can also mean an SGI image, which Pillow reads and writes. ImageMagick separates the two: its SGI coder writes SGI, and its RGB coder writes raw samples.

In this converter your browser decodes the PNG, then ImageMagick writes the RGB file. The page sets no quality. Files you select together are converted one after another, each downloading on its own.

Other ways to convert PNG to RGB

  • ImageMagick, raw samples: run magick texture.png -depth 8 rgb:texture.rgb. ImageMagick's RGB format needs the size and depth supplied when it is read back, so write down the picture size.
  • Pillow: in Python, Image.open("texture.png").convert("RGB").tobytes() returns the raw bytes, which you save to a file. Pillow registers the .rgb ending for its SGI writer, so its own save call would make an SGI image.
  • ImageMagick, SGI: run magick texture.png sgi:texture.rgb when the receiving program wants an SGI header.

Problems with PNG files

  • Layer offset from GIMP: a PNG exported with GIMP's offset option can place the layer differently in other applications. Leave that option off when exporting.
  • Missing camera tags or profile: GIMP makes tags and profiles optional in a PNG export. Switch those metadata options on when you want them kept.
  • Animated PNG: a program that cannot animate shows the default still image, and that frame is the one this page keeps.

Frequently Asked Questions

Everything you need to know about our converter

Does the .rgb file have a header?

How do I open the RGB file after converting?

Is this the same as an SGI .rgb image?

What happens to the transparent parts of my PNG?

Is a 16-bit PNG kept at 16 bits?

Why does the picture look slanted or striped when I load the file?

How big will the RGB file be?

Is my EXIF data kept, and what about animated PNGs?