pimoroni / inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
https://shop.pimoroni.com/?q=inky
MIT License
595 stars 122 forks source link

image.py stretches certain pictures with different aspect ratios to the screen #189

Open kikura opened 7 months ago

kikura commented 7 months ago

Is there any way around this please?

Gadgetoid commented 7 months ago

It would be relatively straight-forward to use PIL to crop or proportionally resize images to your preference, but image.py doesn't try to be smart.

You'll probably need to create a new PIL Image at the target display size, resize your source image, and paste it into the target. eg: https://stackoverflow.com/questions/72492487/pil-paste-image-with-resized-aspect-ratio

kikura commented 6 months ago

Many thanks.

I will try this 👍 On 24 Apr 2024, 10:06 +0100, Philip Howard @.***>, wrote:

It would be relatively straight-forward to use PIL to crop or proportionally resize images to your preference, but image.py doesn't try to be smart. You'll probably need to create a new PIL Image at the target display size, resize your source image, and paste it into the target. eg: https://stackoverflow.com/questions/72492487/pil-paste-image-with-resized-aspect-ratio — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>