A Telegram bot that automatically brands images for an Amharic tech news channel by analyzing each image and overlaying the best-matching "liquid glass" design (created in Figma) before sending it back ready to post.
# Liquid Glass Overlay Bot
A Telegram bot that automatically brands images for an Amharic tech news channel by analyzing each image and overlaying the best-matching "liquid glass" design (created in Figma) before sending it back ready to post.
## Why
Every post in the channel is paired with a relevant image (e.g. a photo of the person being discussed) so readers immediately understand the topic at a glance. This bot adds a consistent branded look on top of those images automatically, using a set of liquid glass design variants prepared in different color schemes — instead of manually applying the overlay in a design tool for every single post.
## How it works
1. Send a photo to the bot.
2. The bot downloads it and analyzes its dominant colors.
3. It picks the closest-matching liquid glass design variant from the asset library.
4. It composites the overlay onto the image.
5. It sends the finished image back to you, ready to post to the channel.
## Features
- 🖼️ Automatic image analysis (dominant color extraction).
- 🎨 Data-driven design variant library — add new Figma exports without touching code.
- 🤖 Automatic best-match design selection.
- 🔁 Manual override (`/variant `) to force a specific design.
- ⚙️ Simple admin commands (`/list_variants`, `/help`).
## Tech Stack
- Language: (`python-telegram-bot` + `Pillow` + `colorthief`)
- Telegram Bot API
- Image processing: Pillow
## Project Structure
```
.
├── assets/
│ └── variants/ # Exported transparent PNG overlays from Figma
│ └── variants.json # Metadata: id, filename, palette, placement rule
├── src/
│ ├── bot.py # Telegram bot entrypoint
│ ├── analyze.py # Image analysis (color extraction)
│ ├── select.py # Design selection logic
│ └── composite.py # Overlay compositing
├── SRS.md
├── README.md
└── .env.example
```
## Setup
1. Clone the repo.
2. Create a bot via @BotFather and get your bot token.
3. Copy `.env.example` to `.env` and fi …