Home / Tools / Image modes

Image modes

Mode is the thing beginners skip and then spend an afternoon debugging. This shows the four you will meet most, on your own image.

Nothing is uploaded. The conversions run in your browser.

The modes you will actually meet

ModeWhat it holdsPer pixelUse it for
RGBThree colour channels3 bytesThe normal working mode for colour
RGBAThree channels plus alpha4 bytesTransparency, compositing, PNG output
LOne channel, 0 to 2551 byteGreyscale, masks, most image processing
1One bit, black or white1 bitFax, scanning, print separations
PAn index into a colour table1 byte plus the tableGIF, small PNGs, limited colour art
CMYKFour print channels4 bytesPrint work, and some scanned files
I and F32 bit integers or floats4 bytesScientific data, depth maps, height fields

Where mode causes trouble

Saving RGBA as JPEG

JPEG has no alpha channel, so this raises an error. Convert first, and decide what should show through the transparent parts:

flat = Image.new("RGB", im.size, "white")
flat.paste(im, mask=im.split()[3])
flat.save("out.jpg")

Filtering a palette image

Blurring a P mode image blurs the palette indexes, not the colours, which produces nonsense. Convert to RGB first, filter, then convert back if you need to.

Comparing images of different modes

ImageChops and most arithmetic need matching modes. Converting both to L first is usually the right move.

Dithering when you did not want it

Going to mode 1 applies Floyd and Steinberg dithering by default, which looks like fine noise. For a hard threshold, turn it off and use point:

hard = grey.point(lambda v: 255 if v > 128 else 0).convert("1", dither=Image.Dither.NONE)

What this tool shows

The greyscale and dithering here use the same standard methods as Pillow: the usual luminance weighting for L, and Floyd and Steinberg error diffusion for 1. The palette panel shows a fixed six level web palette, which is the simple case; Pillow's adaptive palette picks colours from your image and does better.