What inverting an image means
Every pixel of a normal image stores three values, red, green and blue, each from 0 to 255. Inverting turns each value around, into its reverse:
new value = 255 − value
This is the same as the CSS invert() filter at 100%, which the W3C Filter Effects specification defines with a transfer function per channel that maps 0 to 1 and 1 to 0. It changes only red, green and blue, so transparency stays as it is. Applying it twice gives back the original values.
| Color | R, G, B | Inverted | Looks like |
|---|---|---|---|
| White | 255, 255, 255 | 0, 0, 0 | Black |
| Red | 255, 0, 0 | 0, 255, 255 | Cyan |
| Orange | 255, 128, 0 | 0, 127, 255 | Bright blue |
| Mid gray | 128, 128, 128 | 127, 127, 127 | Mid gray |
The tool offers three ways to invert. Full negative applies the formula to all three channels. Single channels applies it only to the channels you pick: inverting only blue turns orange (255, 128, 0) into pink (255, 128, 255). Lightness only is explained below. To turn the result gray, use the black and white image converter, and to read the exact color of a pixel, the color picker from image.
Lightness only: dark, but the same hues
A full negative flips the hues too, so a blue link turns yellow and a green button turns pink. Lightness only flips light and dark and keeps the hue. It works in OKLab, a color space published by Björn Ottosson in 2020, whose three values are perceived lightness L, from 0 for black to 1 for white, plus a and b, which describe how green or red and how blue or yellow a color is. The tool sets L to 1 − L and keeps a and b.
Some results do not exist in the sRGB colors of a screen, because a very dark color cannot be very colorful. Then the tool lowers the colorfulness step by step, with the same lightness and hue, until the color fits. The CSS Color 4 specification describes gamut mapping in the same spirit, by reducing chroma at constant lightness and hue. Computed with this tool:
| Color | R, G, B | OKLab L | Lightness only |
|---|---|---|---|
| White | 255, 255, 255 | 1.000 | 0, 0, 0 |
| Dark gray text | 30, 30, 30 | 0.235 | 178, 178, 178 |
| Link blue | 0, 0, 238 | 0.429 | 43, 102, 255 |
| Red | 255, 0, 0 | 0.628 | 126, 0, 0 |
| Yellow | 255, 255, 0 | 0.968 | 0, 0, 0 |
Yellow is almost as light as white, so it turns almost black, and at that darkness no color is left. OKLab was chosen over HSL on purpose. In HSL, lightness is the average of the largest and the smallest channel, so pure yellow and pure blue both have a lightness of 50% and would not change at all, although yellow looks far lighter.
Dark mode screenshots
Lightness only turns a screenshot of a light page into a dark one: the white background becomes black, black text becomes white, and colored links and buttons keep their color. Photos inside the screenshot are inverted as well, so they look like negatives. Full negative gives the same dark background, but every color flips to its opposite.
Color negative vs film negative
The negative this tool makes is a pure mathematical inversion. A scanned color film negative is different. Color negative film carries an orange mask, made by colored couplers in its magenta and cyan layers, which keeps the colors of the print clean. A plain inversion turns that orange into a strong blue cast, as the orange row in the first table shows. Turning a film scan into a good photo needs the mask removed and the color balance corrected, and this tool does not do that.
PNG or JPEG
PNG keeps every pixel as the tool computed it and keeps transparency. JPEG makes smaller files for photos but compresses with loss, so the colors shift slightly, and it has no transparency: transparent areas are put on white after the colors are inverted. The download always uses the full resolution of your image. Only when an image is larger than the browser can draw, for example above 16.7 megapixels in Safari on iPhones before iOS 18, it is scaled down, and the tool says so. Lightness only takes longer on large photos, and the progress is shown while it runs.
How to invert the colors of an image
- 1Drop an image on the box or tap it to choose one. HEIC photos from an iPhone work too.
- 2Pick Full negative, Lightness only or Single channels, and for single channels choose red, green or blue.
- 3Drag across the picture to compare it with the original.
- 4Choose PNG or JPEG and press Download image.
Sources
- W3C Filter Effects Module Level 1: section 13.1.5, the invert() filter as a component transfer on red, green and blue with the table values amount and 1 − amount
- Björn Ottosson, A perceptual color space for image processing (2020): the OKLab color space, its L, a and b values and the conversion from and to linear sRGB
- W3C CSS Color Module Level 4: the sRGB transfer function in section 19, sample code for color conversions, gamut mapping by chroma reduction at constant lightness and hue in section 14.2.5, and the HSL lightness as the average of the largest and smallest channel in section 7.2
- Brian Pritchard, Why Colour Negatives are Orange: the orange mask of color negative film and its colored couplers in the magenta and cyan layers
Related guides
- JPG vs PNG vs WebP vs AVIF: Which Format to Use
- How to Compress a Photo Under 100 KB
- HEIC Photos Explained: Open, Convert, Avoid
Frequently asked questions
Is my image uploaded?
No. Your browser opens the image, inverts it and saves the new file on your own device. Nothing is sent to a server.
What does inverting the colors of an image do?
Each of the three color channels, red, green and blue, is turned around: a value v from 0 to 255 becomes 255 − v. White becomes black, black becomes white, red becomes cyan and blue becomes yellow. Doing it twice gives back the original values.
What is the difference between Full negative and Lightness only?
Full negative turns every channel around, so the hues flip to their opposites as well: a blue link turns yellow. Lightness only turns light into dark and dark into light but keeps the hue, so the blue link stays blue and only gets lighter. Lightness only suits screenshots for dark mode.
Can I turn a scanned film negative into a photo with this?
Only a rough version. Color negative film has an orange tint built into it, and after a plain inversion that tint turns into a strong blue cast. Removing it needs a correction of the color balance that this tool does not do. Use software made for film scans for that.
Does it keep a transparent background?
Yes, when you save as PNG. Only the red, green and blue values change, the transparency of every pixel stays as it was. JPEG has no transparency, so transparent areas turn white after the colors are inverted.
Does it keep the full resolution?
Yes. The preview is drawn smaller to stay quick, but the download is made from the whole image at its full width and height in pixels. Very large images are scaled down only when the browser cannot draw them at full size, and the tool tells you when that happens.