gemini-logo-remover
Remove the Gemini watermark from images — locally, no server, no upload.
pip install gemini-logo-remover
from gemini_logo_remover import remove_logo
remove_logo("gemini-image.png", "clean.png")
How it works
Gemini stamps a translucent white star in the bottom-right corner:
out = (1 − α)·original + α·white. This package reverses that exact blend, so the pixels
come back instead of being guessed:
- Locate the mark at the known, size-derived slot positions.
- Fit the overlay's strength, its position (down to a fraction of a pixel, so no outline ring is left) and colour so one scaled alpha shape cancels it. Text and texture cannot be cancelled this way, so they are never mistaken for the mark.
- Reverse the blend — lossless; text under the star comes back.
- Level the edge: measure the small tone mismatch between inside and outside the star's outline (robustly, so real edges crossing it are outvoted) and remove it as a smooth offset, then clean compression dots along the edge - only isolated outliers in smooth areas, never real detail.
- Check what is left, and inpaint only a leftover or a mark that no alpha overlay explains.
Everything outside the star's 96×96 box (plus a 2–4 px blend margin at its tips) is returned bit-for-bit as it was. It runs on your
machine with numpy and Pillow — about 0.1 s per image.
The calibrated alpha maps for the current star come from gemini-watermark-remover (MIT, © 2025 Jad, © 2024 AllenK / Kwyshell).
Usage
One image
from gemini_logo_remover import remove_logo
result = remove_logo("in.png", "out.png") # saves out.png
print(result.method, result.clean, result.warnings)
# no file written, work with the Pillow image instead
result = remove_logo("in.png")
result.image.show()
result.save("later.jpg") # .jpg -> JPEG, otherwise PNG
image can be a path, bytes, an open binary file, or a PIL.Image.
Result fields: image, method (alpha = lossless, inpaint, alpha+inpaint, none),
detected, slot (v1 old mark / v2 current star / v3), confidence, clean,
warnings, steps (what ran), output_path.
Many images, in parallel
from gemini_logo_remover import remove_logo_many
items = remove_logo_many(["a.png", "b.png", "c.jpg"], "cleaned/", workers=4)
for item in items:
print(item.source, "ok" if item.ok else f"failed: {item.error}")
One bad file never stops the others; failures are returned in the list.
Command line
gemini-logo-remover photo.png # writes photo_clean.png next to it
gemini-logo-remover *.png -o cleaned/ --workers 4
gemini-logo-remover photo.png --mode alpha # lossless only
python -m gemini_logo_remover photo.png # same thing
Options
| Option | Default | Meaning |
|---|---|---|
mode |
auto |
auto: reverse the watermark, inpaint only what is left. alpha: lossless only, never inpaints (image unchanged + a warning if it cannot). inpaint: skip the alpha step. |
sparkle |
False |
Also inpaint the small V3 slot. Unverified; can damage text near the corner. |
region |
none | (x, y, width, height): skip detection and inpaint exactly this box. |
backend |
local |
local runs on your machine. api uses a hosted server instead (see below). |
Errors
InvalidImageError— the input is not a readable image.ApiError— only forbackend="api".GeminiLogoRemoverError— base class of both.
Optional extras
pip install "gemini-logo-remover[api]" # backend="api" (needs requests)
pip install "gemini-logo-remover[inpaint]" # OpenCV, only used if you opt in (see below)
The rare marks that no alpha overlay explains are filled by a built-in numpy routine: smooth and
predictable, it never draws streaks. OpenCV's Telea inpainting is off by default because on textured
areas (carpets, fabric) it draws cross-shaped smears, and OpenCV is preinstalled in many environments
(for example Colab). To use it anyway: install the extra and set GEMINI_LOGO_REMOVER_INPAINT=opencv.
Most current Gemini images never need inpainting at all.
Hosted API instead of local
remove_logo("in.png", "out.png", backend="api",
api_url="https://your-server.example/api/v1/remove", api_key="...")
Only the bottom-right corner (≤ 480×480 px) is uploaded and the cleaned corner is pasted back
locally. Defaults can be set with GEMINI_LOGO_REMOVER_API_URL and GEMINI_LOGO_REMOVER_API_KEY.
Limits
- It targets original Gemini exports. Screenshots, resized or heavily re-compressed copies move the
mark off its exact position and change its pixels, so the reversal may not apply; you then get
method == "none"and a warning, never a silently damaged image. - A very faint (1–3 levels) trace can remain on a few backgrounds, mostly dark panels and the tip over flat bands.
- It does not remove invisible watermarks (such as SynthID).
Development and publishing
cd python
pip install -e ".[dev]"
pytest
python -m build
twine check dist/*
twine upload dist/*
Bump version in pyproject.toml and __version__ for every release — PyPI never accepts the
same version twice. tools/gen_alpha_data.py regenerates the embedded alpha maps from the web
project.
Testing a change
python python/tools/check_testlogo.py # run the test folder, compare with the baseline
python python/tools/check_testlogo.py --save-baseline # accept the current results as the new baseline
Writes cleaned images and before/now/baseline sheets to analysis/testlogo_run/. Exit code 1 means a regression.
Metadata
Release files for gemini-logo-remover 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gemini_logo_remover-0.2.1.tar.gz | 46.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gemini_logo_remover-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.8 kB
Release files / gemini_logo_remover-0.2.1.tar.gz
| Download URL | gemini_logo_remover-0.2.1.tar.gz |
|---|---|
| Size | 46.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47b58baeb99fa62c83c5da3eb142f943e050e1acd7a66a62b317d19cbc1b3cfb
|
|
BLAKE2b-256 checksum How to use checksums |
ad3d4371e18040dd7694bcfe1f4747a31481150f5f835ce07f4e77d19bafc4b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / gemini_logo_remover-0.2.1-py3-none-any.whl
| Download URL | gemini_logo_remover-0.2.1-py3-none-any.whl |
|---|---|
| Size | 42.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1286c4d41f58537a729bd2d275e4214d2afb3d0f11030e87a1323dd1d25905c3
|
|
BLAKE2b-256 checksum How to use checksums |
4f3a108a5ae2be495956961d945d8e5195c31fcee998cf6778cb6b5e90e69763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|