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 (and a few px of position 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.
- Clean up compression dots along the star's edge, but 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 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[inpaint]" # OpenCV inpainting for the rare non-alpha marks
pip install "gemini-logo-remover[api]" # backend="api" (needs requests)
Without the inpaint extra a built-in numpy fill is used. It is fine for flat backgrounds; install
the extra for textured ones. 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 faint (1–3 levels) trace can remain on some backgrounds, mostly dark panels.
- 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.
Metadata
Release files for gemini-logo-remover 0.2.0
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.0.tar.gz | 40.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gemini_logo_remover-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.9 kB
Release files / gemini_logo_remover-0.2.0.tar.gz
| Download URL | gemini_logo_remover-0.2.0.tar.gz |
|---|---|
| Size | 40.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eac34322a44de2351c2312ed7569e3649ace3107ff053437343291183a1683b3
|
|
BLAKE2b-256 checksum How to use checksums |
e598739622c8ee20bca30e4a662fd5ca572dcc2249ee0d3ca244077399402d09
|
| 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.0-py3-none-any.whl
| Download URL | gemini_logo_remover-0.2.0-py3-none-any.whl |
|---|---|
| Size | 37.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d5f4b2a089e8dfe54b2a8c644d7425310d5b78981058ec9d1c710a7d5d4c3d2
|
|
BLAKE2b-256 checksum How to use checksums |
038ea7fdd7f44cf9126cc14dc3089a4843a9e8f34083fd6005a739c1cd2f44d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|