π Telegram Bot for Image Format Conversion using the Telethon library and PIL (Pillow) π§βπ». This bot allows users to easily convert images between various formats directly within Telegram!
- π Supports multiple image formats: JPEG, JPG, PNG, and WEBP.
- π₯ Effortless Image Upload: Users can send images directly to the bot, which will automatically handle the conversion.
- π² Interactive UI: The bot provides a user-friendly interface with buttons to start the conversion process.
- π Automated Conversion Process: The bot checks the format of the uploaded image and guides the user to select the desired output format.
- β Error handling: Provides feedback on unsupported formats and failed conversions.
-
Clone the repository:
git clone https://github.com/nakul-verma2/image-format-changer-bot
-
Open Folder:
cd image-format-changer-bot
-
Create a image folder inside repo:
mkdir image
-
Create a virtual environment:
python3 -m venv myenv && source myenv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Edit your bot token, api_id, and api_hash in the script bot.py:
bot_token = "your-bot-token" api_id = "your-api-id" api_hash = "your-api-hash"
-
Run the bot:
python3 bot.py
- Send
/start
to begin interacting with the bot. - Upload an image and select the format you want to convert it to.
- The bot will send you the converted image in the format of your choice!
- JPEG
- JPG
- PNG
- WEBP
- Telethon: For interacting with the Telegram API.
- Pillow (PIL): For image processing.
/start
: Begin interaction with the bot./Help
: Provides information on supported formats and usage instructions./Change Format Of An Image
: Convert images to another format.
Feel free to open issues or submit pull requests to enhance the functionality of the bot.
This project is licensed under the MIT License.