1 2 3 4 5 6 7 8 9 10 11 | from PIL import ImageEnhance
def _sharpen(image, sharpness=1.6):
"""
Returns a sharpened copy of an image.
Resizing down or thumbnailing your images with PIL.Image tends to make them blurry. I apply this snippet to such images in order to regain some sharpness.
"""
sharpener = ImageEnhance.Sharpness(image)
sharpened_image = sharpener.enhance(sharpness)
return sharpened_image
|
More like this
- resize to thumbnail with scale-to-fill by rennat 3 years, 4 months ago
- thumbnail an image by limodou 4 years, 11 months ago
- Thumbnails in admin using django-thumbnails-works by dperetti 1 year, 2 months ago
- Crop and scale image to a given size by rpw 4 years, 9 months ago
- Resize image on save by David 3 years, 10 months ago
Comments