How Color Inversion Works: Why Only Photos Look Wrong

Contents
Why color inversion makes only photos look weird
Color inversion was originally built to flip dark text on a light background into light text on a dark background, so your eyes get less glare. The catch is that it doesn't pick out text and invert only that. It runs every pixel drawn on the screen through the same single formula.
So when that formula hits an image that already mixes a lot of colors, like a photo or a video, a blue sky turns yellowish and a red apple turns cyan — the result looks like a film negative. Your eyes read it as "broken," but it's really just the formula doing exactly what it's defined to do.
What the math actually is: and how to check it yourself
The math behind color inversion is simple. Every pixel on screen is described by three values — red (R), green (G), and blue (B) — each from 0 to 255, and inverting means replacing each value with 255 minus that value. Nothing more. Invert pure white (255,255,255) and you get black (0,0,0). Invert bright red (255,0,0) and you get cyan (0,255,255).
You can verify this without any tool. Open the console in your browser's developer tools (F12) on any webpage and type the line below. You'll see color inversion applied to the images on that page right where they are.
document.querySelectorAll('img').forEach(el => el.style.filter = 'invert(1)')
Close the console or refresh the page and the inversion disappears, leaving the original photos. If you stack the same inversion on the same element a second time, you'll see the colors come back too — because subtracting from 255 twice lands you back on the original value.
Check it with our tool. Instead of opening developer tools and typing code every time, just upload a single image file and get the result of that same formula as a PNG right away.
Free · No sign-up · Invert image colors (negative) right in your browser and download a PNG

Where people get stuck
Symptom
Cause
Text looks fine but photos look strange
The inversion formula applies the same way to every pixel, with no distinction between text and photos
The sky looks yellow and the leaves look purple
This happens because each channel (R, G, B) is swapped for its complementary color, 255 minus the value
Inverting twice brings things back to normal
The arithmetic result of subtracting from 255 twice, which equals the original value
A gray photo keeps its colors when inverted, only the brightness changes
Gray means R=G=B, so all three values flip together and the image stays in the gray family
Summary
- Color inversion is a simple calculation that replaces a pixel's R, G, and B values with 255 minus each value.
- That calculation applies the same way to every pixel on screen, with no distinction between text and photos.
- So when you turn on dark mode or the color inversion accessibility feature, photos and videos alone looking like film negatives is the normal, expected result of the math.
- Apply the same inversion twice and you land exactly back on the original values, and a grayscale image keeps its colors when inverted.
- You can verify the calculation yourself in the browser developer tools console, but if you want to save the result as a file, using a tool is faster.
Free · No sign-up · Invert image colors (negative) right in your browser and download a PNG
Frequently asked questions
Why does inverting an image twice bring back the original?
Inversion subtracts each channel value from 255. Invert some value V and you get 255-V. Invert that result again and you get 255-(255-V), which is exactly V. So stacking the same inversion twice is arithmetically identical to the original.
Why do only photos look so strange when I turn on dark mode?
Dark mode, or the screen inversion accessibility feature, applies the same inversion calculation to every pixel drawn on screen. Simple combinations like black text on a white background still read fine when inverted. A photo that already mixes many colors doesn't — each color flips to its complement and looks off.
What happens if I invert a black-and-white (grayscale) photo?
A grayscale pixel has the same R, G, and B values (for example, 128,128,128). Inverting subtracts all three from 255 equally, so the result also has R=G=B and stays grayscale — the bright areas become dark and the dark areas become bright. That's why inverting a black-and-white photo looks like a film negative where only the light and dark are flipped.
Can I turn an inverted image back to its original colors?
Yes. Invert the inverted image again and you get the original colors back exactly. Inversion is a reversible calculation — 255 minus the value — so running the same process twice always produces the same result as the original.
This article was adapted from our Korean original. Read the Korean original