Backend & AI

What is Pillow (image processing)

What it is

A Python library for images: open, rotate, shrink, save in another format, draw on top.

How we use it

In the gaming-club loyalty card it works with qrcode to draw the client's personal QR code, which the administrator scans to credit a visit.

Where it helps a business

  • A bot or website has to assemble an image itself: a customer card with a QR code, a cover, a preview.
  • Images need to be shrunk and re-saved so pages and messages stay light.

How we use it

In the gaming-club loyalty card Pillow works with the qrcode library to draw a customer's personal QR code. The customer shows it to the administrator, who scans it with a phone camera, and the bot opens the customer's profile to credit a night.

Common problems

  • A phone photo lies on its side. A phone records the rotation in a camera tag instead of rotating the pixels. Without reading the tag a product photo would appear rotated, which is why the online store server rotates the frame by the tag, shrinks it and converts it to webp.
  • Heavy images. A phone original weighs megabytes; the website and bot get a reduced copy.

When you do not need it

If a designer prepares the images and they do not change, there is no need to process them in code: compressing them once at upload is enough.

โ† All terms

Need a website, a bot or automation?

Terms explained โ€” now let's get to work: tell us about the task and we'll turn it into a clear work plan.