Skip to content

Commit

Permalink
Added IM6/7 notice to Image.alpha_channel + docs #495
Browse files Browse the repository at this point in the history
  • Loading branch information
emcconville committed Sep 14, 2020
1 parent a6dbf02 commit 67da354
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changes.rst
Expand Up @@ -17,6 +17,7 @@ Unreleased.
- Added :meth:`Image.data_url() <wand.image.Image.data_url>` method. [:issue:`489`]
- Added :attr:`Image.sampling_factors <wand.image.BaseImage.sampling_factors>` property. [:issue:`491`]
- Added :meth:`Image.encipher() <wand.image.BaseImage.encipher>` & :meth:`Image.decipher() <wand.image.BaseImage.decipher>` methods.
- Argument ``fuzz`` for :meth:`Image.transparent_color() <wand.image.BaseImage.transparent_color>` now accepts :class:`numbers.Real` numbers.
- Uniformed additional pre-read parameters between :meth:`Image.__init__()` & :meth:`Image.read()`.


Expand Down
20 changes: 17 additions & 3 deletions wand/image.py
Expand Up @@ -1285,7 +1285,7 @@ def __array_interface__(self):
def alpha_channel(self):
"""(:class:`bool`) Get state of image alpha channel.
It can also be used to enable/disable alpha channel, but with different
behavior new, copied, or existing.
behavior such as new, copied, or existing.
Behavior of setting :attr:`alpha_channel` is defined with the
following values:
Expand All @@ -1311,6 +1311,18 @@ def alpha_channel(self):
- ``'background'`` replaces full-transparent color with background
color.
.. note::
The :attr:`alpha_channel` attribute will always return ``True``
if alpha channel is enabled, and ``False`` otherwise. Setting
this property with a string value from :const:`ALPHA_CHANNEL_TYPES`
will resolve to a :class:`bool` after applying channel operations
listed above.
With ImageMagick-6, values ``'on'`` & ``'off'`` are aliased to
``'activate'`` & ``'deactivate'``. However in ImageMagick-7,
both ``'on'`` & ``'off'`` have their own behavior.
.. versionadded:: 0.2.1
Expand Down Expand Up @@ -8103,8 +8115,10 @@ def transparent_color(self, color, alpha, fuzz=0, invert=False):
.. versionadded:: 0.3.0
.. versionchanged:: 0.6.3 Parameter ``fuzz`` type switched from
Integral to Real.
.. versionchanged:: 0.6.3
Parameter ``fuzz`` type switched from Integral to Real.
"""
assertions.assert_real(alpha=alpha, fuzz=fuzz)
if isinstance(color, string_type):
Expand Down

0 comments on commit 67da354

Please sign in to comment.