Skip to content

Commit 17c3a47

Browse files
committed
Updated What's New doc to include Image.channel_fx example
1 parent 7d67391 commit 17c3a47

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Unreleased.
4343

4444
- [DOC] Updated Python versions to reflect current regression testing.
4545
- [TEST] Added Python 3.12 regression test. [:issue:`648` by Thijs Triemstra]
46+
- [TEST] Added pyproject.toml regression test.
4647

4748

4849
.. _changelog-0.6:

docs/whatsnew/0.7.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,37 @@ language. All supporting Python 2 code in :mod:`wand.compat` has been
1313
remove.
1414

1515

16+
Channel FX
17+
''''''''''
18+
Wand now supports Channel FX operations to create, copying, and/or extract data
19+
from color channels. For example, extracting a `meta` channel as a new image::
20+
21+
>>> from wand.image import Image
22+
>>>
23+
>>> with Image(filename='tagged_image.psd') as img:
24+
... with img.channel_fx('meta') as meta:
25+
... meta.save(filename='meta_channel.png')
26+
27+
Each channel can be accessed by named (e.g. `red`, `green`, `blue`, etc)
28+
or by index (e.g. `0`, `1`, `2`, etc). The following operations are supported:
29+
30+
+---------+----------------------------------------------------------------+----------------------+
31+
| FX | Action | Example |
32+
+=========+================================================================+======================+
33+
| ``<=>`` | Exchange two channels. | ``red <=> green`` |
34+
+---------+----------------------------------------------------------------+----------------------+
35+
| ``=>`` | Copy one channel to another. | ``red => green`` |
36+
+---------+----------------------------------------------------------------+----------------------+
37+
| ``=`` | Assign a constant value to a channel. | ``red = 50%`` |
38+
+---------+----------------------------------------------------------------+----------------------+
39+
| ``,`` | Write a new image with channels in a specified order. | ``red, green, blue`` |
40+
+---------+----------------------------------------------------------------+----------------------+
41+
| ``;`` | Add a new output image for the next set of channel operations. | ``red; green`` |
42+
+---------+----------------------------------------------------------------+----------------------+
43+
| ``|`` | move to the next input image for the source of channel data. | ``| grey => alpha`` |
44+
+---------+----------------------------------------------------------------+----------------------+
45+
46+
1647
Evaluate Images
1748
'''''''''''''''
1849

@@ -43,6 +74,8 @@ In an effort to modernize the codebase, Wand will start migrating from
4374
will still be available for Wand 0.7.x releases.
4475

4576

77+
.. note::
78+
4679
For "What's New in Wand 0.6", see `previous announcements`_.
4780

4881
.. _previous announcements: 0.6.html

0 commit comments

Comments
 (0)