JPG to RGB Converter

Turn a JPG into raw red, green and blue samples, in your browser.

or drop files here

JP

JPG Format

JPEG image

A lossy raster image format defined by the Joint Photographic Experts Group (ISO/IEC 10918-1), designed for photographs.

  • Lossy compression
  • 8 bits per color channel
  • No alpha transparency
RG

RGB Format

Raw RGB samples

An uncompressed stream of red, green and blue samples. The file has no header, so readers need the width, height and bit depth supplied.

  • No header
  • No compression
  • Three channels per pixel

How to convert JPG to RGB

Follow these steps to convert JPG to RGB online.

    1

    Choose your JPG 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 JPG to RGB

  • The result is raw samples with no header.
  • You must supply width, height and bit depth to read it.
  • The file is larger than the JPG.
  • EXIF and color profile are dropped.

About JPG and RGB

What is a JPG file?

JPG is the everyday name for JPEG, the format of the Joint Photographic Experts Group. Its specification appeared as ITU-T T.81 (1992), then as ISO/IEC 10918-1 (1994). A JPG compresses a picture with a discrete cosine transform followed by Huffman coding, then adds a header that records its width and height. Every color channel gets 8 bits and nothing is kept for transparency. Both endings, .jpg and .jpeg, mean the same thing, and the registered media type is image/jpeg. Cameras and scanners write it by default.

Programs that open JPG files

  • Windows, Mac and Linux: a JPG opens for editing in GIMP, and ImageMagick can read it.
  • Web: Chrome and Firefox display a JPG without extra software.
  • Mobile: Safari displays a JPG on a phone.

JPG and RGB compared

  • Header: a JPG records its size and settings inside the file, whereas raw RGB records none.
  • Compression: JPG is lossy, and raw samples are uncompressed.
  • Samples: the raw output is red, green and blue values with no alpha, one byte each.
  • Name clash: an .rgb ending may also mean an SGI image, which is laid out differently.

A raw RGB file is nothing but red, green and blue samples in a row. With no header, nothing in it tells a program the width, height or bit depth. The browser decodes the JPG and passes the pixels to ImageMagick, which writes them as raw samples. They pass through 8-bit RGBA first, so the metadata is left behind. You must tell any reader the width, height and format yourself.

Other ways to convert JPG to RGB

  • ImageMagick: magick photo.jpg -depth 8 RGB:samples.rgb writes raw red, green and blue samples. The -depth option sets the depth of raw formats such as RGB, whose depth the file does not record.
  • Pillow: from PIL import Image; pixels=Image.open('photo.jpg').convert('RGB'); open('samples.rgb','wb').write(pixels.tobytes()) saves the pixels as raw bytes. Pillow reads JPEG files, and tobytes() returns the unprocessed pixel data.

Problems with JPG files

  • Blocky or smudged areas: raw RGB shows the flaws exactly as decoded and can't repair them.
  • No transparency: a JPG has no alpha channel, so the samples have nothing to hold.
  • Some old players stall: progressive JPGs can be rejected by aging photo frames, and re-saving without progressive scans fixes it.
  • The quality scale varies: one editor's quality value is not another's, so identical settings can give different files.

Frequently Asked Questions

Everything you need to know about our converter

What kind of RGB file does this make?

How do I open the .rgb file?

Why does a viewer show noise or a sheared picture?

How do I convert JPG to RGB?

Is the .rgb file smaller than the JPG?

Does the .rgb carry the photo's metadata?

What if I need an SGI .rgb image?

What do I get if I choose several JPGs?