Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Telegram inline bot that generates autostereogram (Magic Eye) images with hidden 3D text.

License

Notifications You must be signed in to change notification settings

malbiruk/txtstereobot

Repository files navigation

Text to Stereogram Telegram Bot

Telegram inline bot that generates autostereogram (Magic Eye) images with hidden 3D text.

Try it live → @txtstereobot

Usage

Type @yourbotname hello world in any Telegram chat. Use dots (.) for line breaks:

@yourbotname hello.world

Generates a stereogram with "HELLO" on line 1 and "WORLD" on line 2.

Supports emoji too: @yourbotname hi 😀

How to View

  1. Relax your eyes and look "through" the image
  2. Or cross your eyes slightly until patterns overlap
  3. The hidden 3D text will pop out!

Setup

Environment Variables

Create a .env file:

BOT_TOKEN=your_telegram_bot_token
CACHE_CHANNEL_ID=-100xxxxxxxxxx
  • BOT_TOKEN - Get from @BotFather
  • CACHE_CHANNEL_ID - Private channel ID where the bot uploads images for caching (bot must be admin)

Docker (Recommended)

docker compose up -d

Local Development

Requires Python 3.13+ and uv.

# Install dependencies
uv sync

# Run the bot
uv run python main.py

Note: You need Noto fonts installed locally:

  • Fedora: dnf install google-noto-sans-fonts google-noto-emoji-fonts
  • Debian/Ubuntu: apt install fonts-noto-core fonts-noto-color-emoji

How It Works

  1. Text is rendered as a depth map (white text on black background)
  2. SIRDS algorithm generates the stereogram by shifting repeating pattern strips based on depth
  3. Your brain interprets the horizontal pixel shifts as 3D depth when you defocus your eyes

License

MIT

About

Telegram inline bot that generates autostereogram (Magic Eye) images with hidden 3D text.

Topics

Resources

License

Stars

Watchers

Forks

Contributors