Skip to main content
PPDF123

Invert or Recolor a PDF

Replace and Invert Colors recolors a PDF by full inversion, a high-contrast pair such as white on black, one custom color, or greyscale. Text stays selectable because color operators are edited, not pages rasterized.

Drag and drop files here, or click to choose

Accepts PDF · up to 500.0 MB per file · up to 20 files at once

You can also paste a file with Ctrl/Cmd+V, or from the clipboard menu.

Replace / Invert Color rewrites the colour-setting operators in the page and form content streams (`rg`, `RG`, `g`, `G`, `k`, `K`, `sc`, `scn`) and, for the inversion modes, the image `/Decode` arrays, inline-image samples, annotation colours and shading stops.

Four modes. `FULL_INVERSION` flips every colour set explicitly in the page, so white text and fills become black and the reverse; a page with no painted background stays white. `HIGH_CONTRAST_COLOR` paints a solid background and redraws the content in one of four foreground/background pairs: white on black, black on white, yellow on black or green on black. `CUSTOM_COLOR` replaces every colour with a hex value you choose. `COLOR_SPACE_CONVERSION` runs Ghostscript's `pdfwrite` device with `-sColorConversionStrategy=Gray` to convert the whole document to greyscale.

Text stays selectable, because this edits colour operators rather than rasterising pages. In `FULL_INVERSION` images are inverted through their `/Decode` arrays, so they remain images and simply become negatives. `HIGH_CONTRAST_COLOR` and `CUSTOM_COLOR` leave images unchanged.

Password-protected files are unlocked for you on this page once you enter the password; API callers run Unlock first. The grayscale mode needs Ghostscript on the server.

Features

  • Content-stream colour rewrite: rg / RG / g / G / k / K / sc / scn
  • Inversion modes also flip image `/Decode` arrays, inline images, annotation colours and shading stops
  • Four modes: full inversion, high contrast, custom colour, grayscale
  • Anonymous API at /api/v1/misc/replace-invert-pdf

When to use this tool

  • Turn a white-background deck into a dark, low-glare copy
  • Prepare a high-contrast print for a low-vision reader
  • Convert a colour report to grayscale before a mono print run

How do I invert the colors of a PDF?

  1. Upload a PDF.
  2. Choose a mode under Color transform.
  3. For high contrast, pick a contrast combination; for custom colour, pick the replacement colour.
  4. Click Process and download the recoloured PDF.

Limits and edge cases

  • A colour rewrite, not an accessibility audit: check the result before publishing
  • High contrast and custom colour recolour fills as well as text; check pages with coloured backgrounds
  • Grayscale mode needs Ghostscript; the endpoint returns 503 without it
  • Password-protected files need the password; API callers run Unlock first
  • Upload limit on this website: 500 MB per file, sent in chunks above about 95 MB. A single direct API request body is capped at 100 MB.

Examples

  • A white slide with black text becomes black with white text under High contrast → White text on black
  • Full inversion on a scanned page turns it into a photographic negative

Privacy for this tool

Files are uploaded over HTTPS, processed in memory or a short-lived temporary directory on our servers, and deleted when your result is ready. We do not keep copies for later browsing, training, or advertising profiles. See the Privacy Policy for retention details and AdSense cookie disclosures.

Frequently asked questions

What did high contrast apply?
The chosen background is painted behind each page and every explicit colour, fills as well as text and lines, is replaced with the chosen foreground. A white slide deck becomes readable in low light, but shapes and table fills also take the foreground colour.
Is the text still selectable?
Yes. The content stream is rewritten, so the text operators and glyphs are unchanged — only their colour is.
Are images inverted?
Only in Full inversion, which flips each image's `/Decode` array (and inline-image sample bytes) so photos become negatives. High contrast and custom colour leave images unchanged.
What does color space conversion do?
It runs Ghostscript's pdfwrite device with a grey colour-conversion strategy, converting colour images and fills to grayscale.
Does it need Ghostscript?
Only for the color space conversion mode. The other three modes are pure PDF rewrites with no external binary.

Last updated:

Call this from code

Every tool on this site is a plain REST endpoint - no account or API key needed for anonymous use. Built for AI agents and developers as much as for browsers.

curl -X POST "https://pdf123.xyz/api/v1/misc/replace-invert-pdf" \
  -F "[email protected]" \
  -F "replaceAndInvertOption=HIGH_CONTRAST_COLOR" \
  -F "highContrastColorCombination=WHITE_TEXT_ON_BLACK" \
  -F "customColor=#000000" \
  -o output.pdf

Also available as an MCP tool for agent clients that speak Model Context Protocol (JSON-RPC 2.0 over POST /mcp). Full API reference

Use it from an AI agent

Skill

Claude Code, Codex, Cursor and other AI agents can run Replace & Invert Colors for you with this skill: /skills/pdf123-replace-invert-color.md

All agent skills

Files are used only for this processing job and deleted automatically afterward.