Skip to content

denuwanpro/removebanana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍌 RemoveBanana

Remove invisible AI watermarks from Google Gemini-generated images using reverse alpha blending mathematics.

npm version License: MIT

Don't want to self-host? Use our free online tool: removebanana.eu.cc β€” No sign-up, unlimited usage, 100% browser-based! πŸš€


What is this?

Google's AI image generators (Gemini, Imagen 2, Imagen 3, Nano Banana) embed invisible SynthID watermarks into every generated image. These watermarks are invisible to the human eye but can be detected by automated systems.

RemoveBanana uses the exact mathematical inverse of Google's alpha blending formula to perfectly reconstruct the original pixels β€” no AI guessing, no quality loss.

Gemini adds:     watermarked = Ξ± Γ— logo + (1 - Ξ±) Γ— original
We reverse it:   original = (watermarked - Ξ± Γ— logo) / (1 - Ξ±)

Supported Models

  • βœ… Google Gemini (all versions)
  • βœ… Imagen 2
  • βœ… Imagen 3
  • βœ… Nano Banana AI

Installation

npm install removebanana canvas

Note: The canvas package (node-canvas) is required for Node.js usage. It provides the Canvas API that the engine needs for image processing.

Quick Start

Remove watermark from a file

const { removeWatermark } = require('removebanana');

// Simple usage β€” output saved as input_clean.png
await removeWatermark('./gemini-image.png');

// With custom output path
await removeWatermark('./input.png', './output.png');

// With options
await removeWatermark('./input.jpg', './output.jpg', {
  format: 'jpeg',
  quality: 0.95,
  silent: false
});

Remove watermark from a Buffer

const { removeWatermarkFromBuffer } = require('removebanana');
const fs = require('fs');

const inputBuffer = fs.readFileSync('./gemini-image.png');
const { buffer, meta } = await removeWatermarkFromBuffer(inputBuffer, {
  format: 'png'
});

fs.writeFileSync('./clean-image.png', buffer);
console.log('Watermark info:', meta.watermark);

Use in an Express API

const express = require('express');
const multer = require('multer');
const { removeWatermarkFromBuffer } = require('removebanana');

const app = express();
const upload = multer();

app.post('/api/remove-watermark', upload.single('image'), async (req, res) => {
  const { buffer } = await removeWatermarkFromBuffer(req.file.buffer, {
    format: 'png',
    silent: true
  });
  
  res.set('Content-Type', 'image/png');
  res.send(buffer);
});

app.listen(3000, () => console.log('API running on port 3000'));

API Reference

removeWatermark(inputPath, [outputPath], [options])

Remove watermark from a file and save the result.

Parameter Type Description
inputPath string Path to the input image
outputPath string (Optional) Output path. Defaults to input_clean.ext
options.format string Output format: 'png', 'jpeg', 'webp'
options.quality number Quality for lossy formats (0-1, default: 0.95)
options.silent boolean Suppress console output

Returns: Promise<{ outputPath: string, meta: Object }>

removeWatermarkFromBuffer(inputBuffer, [options])

Remove watermark from a Buffer and return the result as a Buffer.

Parameter Type Description
inputBuffer Buffer Input image buffer
options Object Same options as removeWatermark

Returns: Promise<{ buffer: Buffer, meta: Object }>

How It Works

  1. Detect β€” Identifies the watermark size (48Γ—48 or 96Γ—96) and position using template correlation
  2. Extract Alpha Map β€” Calculates the watermark's alpha channel from reference templates
  3. Adaptive Detection β€” Uses coarse-to-fine template matching for non-standard positions
  4. Reverse Blend β€” Applies the inverse alpha blending formula to reconstruct original pixels
  5. Recalibrate β€” Fine-tunes alpha gain and sub-pixel alignment for perfect removal

Online Tool

Don't want to install anything? Use our free online tool:

🌐 removebanana.eu.cc

  • 100% browser-based β€” your images never leave your device
  • No sign-up required
  • Unlimited usage
  • All formats supported (PNG, JPEG, WebP)

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

Support the Project

If this tool saved you time, consider supporting us:

β˜• Buy Me a Coffee

License

MIT Β© RemoveBanana


🍌 Made with love by RemoveBanana
removebanana.eu.cc

About

🍌 Remove invisible AI watermarks from Google Gemini images β€” npm package

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors