Protect sensitive images with watermarks
Features • Deployment • Usage • Credits
A Telegram bot that helps protect sensitive images by adding customizable watermarks. It ensures that your sensitive images remain confidential and secure from unauthorized use, making it an ideal tool for safeguarding your images.
- Customizable: Offers flexible customization options for text size, opacity, and designs to suit your preferences.
- Watermarking: Automatically adds a watermark to images based on the user's configuration.
- Delete Original Photos: Automatically delete the original images after watermarking.
- Open Telegram and search for @BotFather.
- Start a chat and send /newbot.
- Choose a name and username for your bot.
- Receive and save the Bot Token provided by BotFather.
Render provides a cloud hosting solution that simplifies application deployment without the need for server management. Follow these steps to deploy the bot on Render:
- Go to Render and log in to your account.
- Click "+ New" > Web Service
- Choose Source Code > Existing Image
- Image URL : luqmanhy/tg-watermarker-bot
- Click Connect
- Configure the service:
- Add an environment variable:
- Key: TELEGRAM_TOKEN
- Value: Your Telegram Bot Token from BotFather.
- Click Deploy Web Service to deploy
If you prefer to deploy the bot on your own server, you can do so using the following methods:
- Clone the repository:
git clone https://github.com/luqmanhy/tg-watermarker-bot.git
cd tg-watermarker-bot
- Set up the .env file with your Telegram Bot Token:
cp .env.example .env
- Build and run the Docker container:
docker build -t tg-watermarker-bot .
docker run --name watermarker --env-file=.env -it tg-watermarker-bot
- Clone the repository:
git clone https://github.com/luqmanhy/tg-watermarker-bot.git
cd tg-watermarker-bot
- Set up the .env file with your Telegram Bot Token :
cp .env.example .env
- Install the required Python packages:
pip install -r requirements.txt
- Run the application:
python3 app/app.py
Once the bot is running, you need to set up a webhook so Telegram can communicate with your bot:
- Determine the URL of your hosted bot. For Render, it will be something like https://your-app-name.onrender.com.
- Use the following command to set up the webhook:
curl -X POST "https://api.telegram.org/bot<YOUR_BOT_API_TOKEN>/setWebhook" -d "url=<YOUR_BOT_URL>"
Replace <YOUR_BOT_API_TOKEN> with your bot token and <YOUR_BOT_URL> with your deployed bot URL.
- Verify the webhook setup:
curl "https://api.telegram.org/bot<YOUR_BOT_API_TOKEN>/getWebhookInfo"
Ensure the response includes your bot URL and indicates that the webhook is set. 4. Test the bot by sending a message or image to ensure it works as expected.
- Watermarking: When a photo is received with a caption, the bot adds the watermark based on the user's settings.
- Customize : /set commands allow users to update settings like size, opacity, space, and angle for watermarks.
Users can customize the following settings:
- size: Font size for watermark text.
- color: Color of the watermark text.
- opacity: Opacity of the watermark.
- space_x and space_y: Horizontal and vertical
- spacing between watermarks.
- angle: Rotation angle of the watermark.
/set size 50 - Set the watermark font size to 50.
/set opacity 0.5 - Set the opacity of the watermark to 0.5.
We welcome contributions! Feel free to submit Pull Requests or report Issues.
This utility is licensed under the MIT license. You are free to use, modify, and distribute it, as long as you follow the terms of the license. You can find the full license text in the repository - Full MIT license text.