Cadmeo

Invert Colors

Choose an image

Pick a file above and the inverted version appears here. Nothing is uploaded. The image is read and processed in this page.

Inversion flips every colour in an image, turning it into a photographic negative. The operation is exactly one subtraction per channel. It is its own inverse, and it loses nothing. Inverting twice returns the original image bit for bit.

How it works

new value = 255 - old value, for each of red, green and blue

255
the maximum value of an 8-bit channel
alpha
left untouched, so transparent areas stay transparent rather than becoming opaque black
  • White becomes black and black becomes white, because 255 - 255 is 0 and 255 - 0 is 255.
  • Each colour becomes its complement: red becomes cyan, green becomes magenta, blue becomes yellow.
  • Mid-grey is almost unchanged, 128 inverts to 127, which is why a flat grey area looks the same either way.
  • Alpha is skipped, so a PNG with transparency keeps it.

This is a channel inversion in RGB, which is not the same as the colour negative of film. Film negatives carry an orange mask and a non-linear response curve, so digitising a negative and inverting it gives a colour cast that needs correcting separately.

Examples

A pure colour

Colour

Red, rgb(255, 0, 0)

Result

Cyan, rgb(0, 255, 255)

Red inverts to its complement. The same applies to green and blue, giving magenta and yellow.

The extremes

Colours

White and black

Result

Black and white

The most visible case, and the reason inversion reads as a negative rather than as a colour shift.

Inverting twice

Action

Invert the inverted image

Result

The original, exactly

255 - (255 - v) is v. Nothing is rounded or clipped, so the round trip is lossless.

Frequently asked questions

Does inverting lose any quality?

No. Every channel value maps to exactly one other value and back again, with no rounding or clipping. Inverting twice returns the original pixel data bit for bit, which is unusual among image operations.

Why does my mid-grey image look almost unchanged?

Because mid-grey is near the centre of the range. 128 inverts to 127, a difference no one can see. Inversion has the most visible effect on light and dark areas and almost none in the middle.

Can I use this to develop a film negative?

Only roughly. Colour film carries an orange base mask and a non-linear response, so a straight RGB inversion of a scanned negative comes out with a strong cyan-blue cast. It gets you to something recognisable; proper conversion needs per-channel curves.

What happens to transparent areas?

They stay transparent. Only the red, green and blue channels are inverted; alpha is left alone. Inverting alpha too would turn every transparent region opaque, which is almost never what anyone wants.

How is this different from converting to greyscale?

Greyscale removes colour, collapsing each pixel to a single brightness. Inversion keeps all the colour and flips it. The two are independent. You can invert a greyscale image and get a greyscale negative.