#๐ Adjusting Ribbon Size for Image Processing Inconsistent Scaling Issue
15 messages ยท Page 1 of 1 (latest)
@trim moon
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.
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?
Look at the image dimensions and make the dimensions of the ribbon some standard proportion of it?
The challenge is that the uploaded images vary significantly in dimensions. I'm looking for a solution that will scale the ribbon proportionally based on the image's size, ensuring it maintains a consistent look across different image dimensions. Any suggestions on the best way to achieve this?
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.
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
So the issue seems to lie with the varying image dimensions rather than the code itself? Is there a way for the bot to analyze the dimensions of the incoming image and automatically adjust the ribbon size accordingly? Ideally, I'd like the bot to calculate the appropriate ribbon dimensions based on the image measurements to maintain consistency across different image sizes
Receive the image. Inspect it for its size? The Pillow library parses most common formats.
Would you say the first is pretty good and the second is too narrow and illegibly small?
yup
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.