Image and colour code
Color inverter for images and HEX codes
Drop an image to invert every pixel in your browser, or scroll down to convert a HEX or RGB code into its inverse and complement with contrast ratios.
- Drop PNG, JPG, WebP, AVIF, GIF, BMP or HEIC up to 20 MB
- Runs in your browser, nothing is uploaded
- HEX and RGB inverter with OKLCH lightness inverse and 180° complement
- WCAG contrast ratios against white and black
Invert an image
Drop an image here
or
PNG, JPG, WebP, AVIF, GIF, BMP or HEIC · up to 20 MB · nothing is uploaded
Or invert a HEX or RGB code
How the maths works
Inversion subtracts every colour channel from 255. Nothing is uploaded, so the result exists only in this tab.
Want the side-by-side comparison slider, strength control or batch mode? You can invert an image on the home page.
How image color inversion works
Drop a PNG, JPG, WebP, AVIF, GIF, BMP or HEIC in the box above and the canvas API subtracts each red, green and blue channel from 255. Alpha is preserved untouched, so logos and cutouts keep their transparent edges. The longest side is capped at 2400 pixels—matching the home page and negative converter—so both phone screenshots and larger photos process quickly in the tab without uploading anything to a server.
Invert a HEX or RGB color
Below the image panel is the colour code converter. Two different ideas hide behind the phrase "opposite colour", and mixing them up is common when someone asks for an inverted colour.
Inversion works per channel. Take #E4572E: red 228, green 87, blue 46. Subtract each from 255 and you get 27, 168, 209, which is #1BA8D1. A safelight orange turns into a slate blue. Do the same to a photograph and you get a negative.
The complement stays inside colour theory. The hue moves 180 degrees around the colour wheel and saturation and lightness are kept, so orange becomes blue at the same brightness. For #E4572E the complement lands close to #2E5FE4. It is a different exact value because inversion flips brightness while the complement preserves it.
OKLCH lightness inversion flips only perceptual lightness (L' = 1 - L) while keeping the color's hue angle and chroma intact. Unlike HSL lightness, OKLCH is perceptually uniform—so flipping a bright orange #E4572E (#701B00) or forest green #228B22 (#006604) produces a natural dark-mode or light-mode counterpart without shifting the hue or making yellows look muddy.
| Starting point | RGB inverse (255 - value) | OKLCH lightness inverse (L' = 1 - L) | Complement (hue +180°) |
|---|---|---|---|
#E4572E safelight orange |
#1BA8D1 |
#701B00 |
#2E5FE4 |
#000000 black |
#FFFFFF |
#FFFFFF |
#000000 |
#808080 mid grey |
#7F7F7F |
#484848 |
#808080 |
#228B22 forest green |
#DD74DD |
#006604 |
#8B228B |
Notice the two greys: for a colour with no hue, RGB channel inversion and 180° complement leave mid grey almost unchanged, while OKLCH lightness inversion accounts for human perception (L = 60% flips to L' = 40%, or #484848).
When to use RGB inversion, OKLCH lightness inversion, or complement
Reach for RGB channel inversion when you want the visual negative: a print negative, a dark-mode version of a white page, or a white logo that has to sit on black. The result is a straight flip of every value, which is what a print shop or a screen printer means by "negative".
Reach for OKLCH lightness inversion when you are adapting a UI palette or brand color between light mode and dark mode and want the same hue at an opposite perceived brightness.
Reach for the complement when you are picking an accent colour. A complement is designed to sit next to the original at the same brightness, which makes it useful for buttons, highlights and paired chart series. It reads as an opposite without turning the palette into a negative.
Reading the contrast ratios
The colour code section also reports how the inverted colour behaves against white and against black, using the WCAG relative-luminance formula:
- 4.5:1 is the minimum for normal body text.
- 3:1 is the minimum for large text (roughly 24 px, or 19 px bold) and for interface boundaries.
- Anything under 3:1 will be hard to read for most people, whatever the colour looks like on your monitor.
Because inversion flips lightness, a colour that passes against white usually fails against black, and the other way around. If you are building a dark theme, the inverted value is a good starting point; check the ratio before you ship it.
Typing a HEX or RGB code
The input field accepts a HEX code with or without the leading hash, in three, six or eight digits, and rgb() values with spaces or commas. Alpha is ignored because inversion applies to the visible colour, while a translucent element keeps its own opacity in your CSS. The colour picker and text field stay in sync in both directions, and nothing is submitted or logged.
Invert an image or a color code
-
01
Drop an image or pick a code
Drag a PNG, JPG, WebP, GIF or BMP into the top box, or scroll down and type #E4572E or rgb(228, 87, 46).
-
02
Read the inverted result
Images invert channel by channel right in the tab. Color codes show both the channel inverse and the 180-degree complement.
-
03
Download or copy
Save the inverted image as a lossless PNG, or copy the inverted HEX and RGB values.