#๐Ÿ”’ Adjusting Ribbon Size for Image Processing Inconsistent Scaling Issue

15 messages ยท Page 1 of 1 (latest)

slim sparrowBOT
#

@trim moon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

trim moon
#

Iโ€™m working on a Telegram bot that adds a ribbon to images. The issue I'm facing is that the ribbon appears too small or too large relative to the image size. I want the bot to automatically adjust the ribbon size to fit different image dimensions properly. Any suggestions on how to achieve consistent scaling across various image sizes?

sly echo
#

Look at the image dimensions and make the dimensions of the ribbon some standard proportion of it?

trim moon
sly echo
#

You'll have to qualify the criterion "look".

#

Maybe pick a height with a fixed ratio of the image height, possibly adjust for the aspect ratio of the image. Maybe also with a minimum. Experiment.

trim moon
#

The images Iโ€™m working with come in various dimensions, so the ribbon should adjust proportionally based on the image size. Ideally, I want the ribbon to cover a consistent percentage of the imageโ€™s width and height, no matter the dimensions. The position of the ribbon should remain fixed at the bottom center of each image

trim moon
sly echo
#

Receive the image. Inspect it for its size? The Pillow library parses most common formats.

trim moon
#

Here are some pictures of what I tried

sly echo
#

Would you say the first is pretty good and the second is too narrow and illegibly small?

trim moon
#

yup

slim sparrowBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.