Skip to content

Commit

Permalink
Document getbbox change for images with alpha [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Mar 5, 2020
1 parent b934b50 commit 20e7a3d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/releasenotes/7.1.0.rst
Expand Up @@ -14,3 +14,12 @@ been resolved.
from PIL import Image
im = Image.open("hopper.jpg")
im.save("out.jpg", quality=0)
If present, only use alpha channel for bounding box
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When the :py:meth:`~PIL.Image.Image.getbbox` method calculates the bounding
box, for an RGB image it trims black pixels. Similarly, for an RGBA image it
would trim black transparent pixels. This is now changed so that if an image
has an alpha channel (RGBA, RGBa, PA, LA, La), any transparent pixels are
trimmed.

0 comments on commit 20e7a3d

Please sign in to comment.