Color Invertimages inverted on your device
Color Invert Color inverter

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

#1BA8D1rgb(27, 168, 209)Inverted: 255 minus each channel
#701B00rgb(112, 27, 0)OKLCH lightness inverse (L' = 1 − L)
#2E5FE4rgb(46, 95, 228)Complement: hue +180 degrees
Inverted colour on white—
Inverted colour on black—

Type a HEX code such as #E4572E, or an RGB value such as rgb(228, 87, 46). All three results update as you type.

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

  1. 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).

  2. 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.

  3. 03

    Download or copy

    Save the inverted image as a lossless PNG, or copy the inverted HEX and RGB values.

Frequently asked questions

How do I invert the colors of an image?
Drop any PNG, JPG, WebP, AVIF, GIF, BMP or iPhone HEIC into the top panel and click Download inverted PNG. Everything is decoded and processed locally in your browser tab, up to 2400 px on the long side.
What is the opposite of a colour?
There are three answers. The RGB channel inverse subtracts each of red, green and blue from 255, so #E4572E becomes #1BA8D1. The OKLCH lightness inverse flips only perceptual lightness (L' = 1 - L) while keeping the hue, turning #E4572E into #701B00. The complement rotates the hue 180 degrees on the colour wheel, turning #E4572E into #2E5FE4. For UI dark/light mode use OKLCH lightness inversion; for accent colours use the complement; for a print negative use RGB channel inversion.
How do I invert a HEX code by hand?
Split the six-digit code into three pairs, convert each pair from hex to decimal, subtract each from 255, then convert back. #E4572E is 228, 87, 46; the subtracted values are 27, 168, 209; in hex that is 1B, A8, D1, so the inverse is #1BA8D1.
Why is the complement of grey still grey?
Grey has no hue, so there is nothing to rotate 180 degrees on the colour wheel. The complement of a neutral colour is the same neutral colour. The channel inverse of mid grey is also nearly unchanged, because 128 becomes 127.
What contrast ratio should I aim for?
Aim for 4.5:1 for normal body text and 3:1 for large text and interface boundaries, following the WCAG AA thresholds. The tool prints both ratios for the inverted colour, so you can see at a glance whether it works behind white or black text.
Are my images or codes stored anywhere?
No. Both image inversion and colour code conversion run in JavaScript in your browser. There is no server request and nothing is logged.