Convert images to Telegram stickers on Linux

To add an image into a sticker pack in Telegram, it needs to fit into a 512x512 px square and its format must be either png or webp.

Instead of opening GIMP or any other image editor to slowly edit every image you want to make into a sticker, there is a much easier and faster way to achieve the same results with a package called ImageMagick.

To install this package run the following command:

  • On Fedora: sudo dnf install ImageMagick
  • On Ubuntu: sudo apt install imagemagick

It can also be installed in a similar way on any other distro using its package manager.

After Installing it, we can use the convert tool to edit our image with a single command:

convert <image>.jpg -resize 512x512 output.png
Converting the image

This fits the image into a 512x512 px square and converts it to the png format.

For ease of use you can insert the following function into your ~/.bashrc or ~/.zshrc to streamline this process:

# Convert an image to a telegram sticker
sticker() {
    filename=$(basename -- "$1")
    convert "$1" -resize 512x512 "$filename"_sticker.png
Bash function

After that you can run $ sticker <image> to generate a <image>_sticker.png file that can be added into a sticker pack.

Show Comments