So i am trying to generate thumbnails using Python/Django sorl-thumbnail
library and i was asked to generate a 150x150 image, something like this (in case you can't see there are some transparent margins on top and on the bottom:
I tried to do:
get_thumbnail(
original_image, '150x150', quality=99, format='PNG'
)
Can i do that with sorl-thumbnail
?? i mean add the transparencies on the top and on the bottom and keeping the full image size at 150x150? If not how can i achieve this with another python package?
thanks
I am not sure about sorl-thumbnail but you can do it with Image. You basically need to create a transparent 150x150 image and put your thumbnail on top of it.
The output with transparent stripes at the top and bottom: