Invert Image Colors
Invert every decoded RGB channel in a verified PNG, JPEG, GIF, or WebP image while preserving alpha, then download a still PNG.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Choose a PNG, JPEG, GIF, or WebP file and wait for byte-container detection, browser decoding, and dimension validation.
- 2.Invert the decoded initial frame, then compare the source and complete natural-size PNG previews.
- 3.Confirm dimensions and output byte size, then download the still PNG.
About Invert Image Colors
Image Color Inverter turns every decoded red, green, and blue channel into its complementary byte value and exports the result as a PNG. Choose a PNG, JPEG, GIF, or WebP file, wait for validation, run the inversion, compare the source and output previews, and download the natural-size result. Reading, detection, decoding, pixel access, transformation, preview, and PNG export all happen inside the current browser tab. The image is not uploaded to Lizely or sent to an external service.
The pixel rule is explicit and deterministic: output red equals 255 minus input red, output green equals 255 minus input green, and output blue equals 255 minus input blue. Alpha is copied unchanged. Black becomes white, white becomes black, red becomes cyan, green becomes magenta, and blue becomes yellow. Tests cover opaque primaries, intermediate channel values, fully transparent pixels, half-transparent pixels, and a multi-pixel RGBA matrix. Applying the channel operation twice returns the same decoded byte values.
Every RGBA slot exposed by Canvas is processed, including RGB slots whose alpha is zero. The algorithm does not skip transparent pixels or force hidden RGB to black. Fully transparent color is invisible, however, and a browser decoder or Canvas may normalize hidden RGB before getImageData returns it. The tool transforms the bytes Canvas actually supplies; it cannot recover hidden source-file channel data that never reaches ImageData. Semi-transparent alpha values remain unchanged.
The filename extension, file-picker filter, and operating-system MIME label are not trusted as format proof. The actual ArrayBuffer is checked with the same pure structural detector used by the paired Base64 image workflow. PNG requires the complete signature, first IHDR structure, and terminal IEND. JPEG requires SOI, a following marker, and terminal EOI. GIF requires GIF87a or GIF89a, enough logical-screen structure, and the trailer. WebP requires an exact RIFF byte count, the WEBP marker, and a bounded VP8, VP8L, or VP8X first chunk. Truncated magic bytes and renamed arbitrary files fail before Canvas work. A Blob labeled with the detected MIME must then decode through createImageBitmap and report real positive dimensions. Structural detection does not replace browser decoding.
Files may be at most 15 MiB. The reported File size is checked before reading, and the actual ArrayBuffer length is checked afterward. Each decoded edge may be at most 8,192 pixels and total area may be at most 24,000,000 pixels. Exact boundaries are accepted; one byte, edge pixel, or pixel-area step beyond them is rejected. These independent limits matter because compressed inputs can expand to large pixel buffers and long narrow images can remain below an area limit while exceeding practical Canvas dimensions. Nothing is silently resized, cropped, sampled, or partially processed.
The output is always a complete PNG and has a separate 32 MiB limit. Canvas first encodes the full natural-size image. A null Blob, invalid size, or Blob above the exact budget fails before a result URL is published. Output is never truncated or silently changed to a lossy format. PNG can be larger than a JPEG, GIF, or WebP source, especially for photographs or noisy images, so the input and output budgets are intentionally separate.
Animated GIF and animated WebP inputs use the browser-decoded initial frame and become one still PNG. Later frames, timing, loops, palettes, and disposal behavior are not preserved. Canvas export also does not promise to preserve EXIF, GPS, comments, ICC profiles, provenance, or other source metadata. Keep the original whenever animation, embedded profiles, or metadata matter. This tool is a byte-channel visual effect, not a color-managed conversion and not film-negative restoration. It does not linearize gamma, model perceptual complementary colors, remove an orange mask, balance scanned film, correct exposure, or perform tonal grading.
Selecting another file immediately increments the job generation, closes the prior ImageBitmap, revokes source and output ObjectURLs, clears old errors and results, and resets busy state. Late file reads, bitmap decodes, and toBlob callbacks cannot publish into a newer selection. Cleanup remains safe through React Strict Mode effect setup and cleanup cycles. Synchronous Canvas export failures, ObjectURL creation failures, and a null toBlob callback result all enter the same guarded failure path, clear busy state, and leave no old download visible. Unmount closes the bitmap and revokes every remaining URL.
Local browser processing improves privacy, but successful decoding is not malware analysis, content moderation, authorship verification, or proof that an image is safe or truthful. SVG, AVIF, HEIC, BMP, TIFF, PDF, and other formats are outside scope even when renamed. For other operations use Image Flipper, Pixelate Image, Blur Image, or Image Overlay. Keep the source file because PNG conversion can change metadata, animation, and color-management behavior even though the decoded RGBA transformation itself is exact.
Methodology & sources
Check reported and actual byte lengths at the exact 15 MiB boundary. Detect a complete PNG, JPEG, GIF, or size-consistent WebP container from bytes while ignoring supplied MIME and filename. Build a Blob with the detected MIME and require createImageBitmap to decode its initial frame. Reject either decoded edge above 8,192 pixels or area above 24,000,000 pixels. Draw at natural dimensions, read complete ImageData, mutate every pixel as 255-R, 255-G, 255-B with unchanged alpha, and put the full matrix back. Encode the Canvas as PNG, reject a null Blob or output above 32 MiB before URL creation, and expose that same Blob for preview and download. Generation, mounted-state, bitmap, URL, synchronous exception, callback, and busy guards prevent stale output and leaks.
Frequently asked questions
- What happens to transparent pixels?
- Every decoded RGB slot is inverted even when alpha is zero, while alpha stays unchanged. Browser decoding or Canvas may normalize visually hidden RGB before the loop sees it.
- Does this preserve animated GIF or WebP input?
- No. The browser-decoded initial frame becomes one static PNG; later frames, timing, looping, and disposal behavior are not preserved.
- Does the tool trust the filename or MIME type?
- No. It recognizes a complete supported container from actual bytes, assigns the detected MIME to a local Blob, and then requires real browser decoding.
- Is the image uploaded?
- No. File reading, detection, ImageData processing, preview, and PNG export stay in the current browser tab.
Related tools
- Image FlipperMirror any photo horizontally or vertically — instant, free, and completely private.
- Pixelate ImagePixelate a whole image or a precise rectangular area without uploading the file.
- Blur ImageBlur a whole image or a precise rectangular area locally, then download a full-resolution PNG.
- Image OverlayPlace one image over another at a chosen position, scale, and opacity without uploading either file.
- Text to ASCII Art GeneratorTurn a local image into copyable ASCII art with adjustable width, density, and light-dark direction.
- Base64 to Image ConverterTurn strict Base64 image data into a validated PNG, JPEG, GIF, or WebP preview and download without uploading it.
Image Tools guides
View all- How to Flip an Image Horizontally or Vertically
- How to Add Blur to an Image (Full or Partial)
- How to Crop Image in Canva: A Complete Guide
- How to Compress Image File Size in Your Browser
- What Colors Are Used in an Image: Pick Exact HEX Codes
- Create an Animated GIF in Photoshop or Your Browser
- How to Resize an Image Without Stretching or Losing Quality
- JPEG vs PNG vs WebP: Which Image Format Should You Use?
- How to Compress Images for the Web Without Losing Quality