Skip to content

Commit c8bb1f5

Browse files
committed
Doc improvements
1 parent db7ade2 commit c8bb1f5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

shared-bindings/bitmapfilter/__init__.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
//| ) -> displayio.Bitmap:
4545
//| """Convolve an image with a kernel
4646
//|
47+
//| The name of the function comes from
48+
//| `OpenMV <https://docs.openmv.io/library/omv.image.html#image.Image.morph>`_.
49+
//|
50+
//| For background on how this kind of image processing, including some
51+
//| useful ``weights`` values, see `wikipedia's article on the
52+
//| subject <https://en.wikipedia.org/wiki/Kernel_(image_processing)>`_.
53+
//|
4754
//| The ``bitmap``, which must be in RGB565_SWAPPED format, is modified
4855
//| according to the ``weights``. Then a scaling factor ``mul`` and an
4956
//| offset factor ``add`` are applied.
@@ -53,9 +60,10 @@
5360
//| Specific weights create different effects. For instance, these
5461
//| weights represent a 3x3 gaussian blur:
5562
//|
56-
//| ``mul`` is number to multiply the convolution pixel results by. When
57-
//| not set it defaults to a value that will prevent scaling in the
58-
//| convolution output.
63+
//| ``mul`` is number to multiply the convolution pixel results by.
64+
//| If `None` (the default) is passed, the value of ``1/sum(weights)``
65+
//| is used (or ``1`` if ``sum(weights)`` is 0). For most weights, his
66+
//| default value will preserve the overall image brightness.
5967
//|
6068
//| ``add`` is a value to add to each convolution pixel result.
6169
//|

0 commit comments

Comments
 (0)