diff --git a/docs/reference/ImageMath.rst b/docs/reference/ImageMath.rst index a72ca92d049..e934fb1378a 100644 --- a/docs/reference/ImageMath.rst +++ b/docs/reference/ImageMath.rst @@ -31,20 +31,21 @@ Example: Using the :py:mod:`~PIL.ImageMath` module b=im2 ) -.. py:function:: lambda_eval(expression, options) +.. py:function:: lambda_eval(expression, options, **kw) Returns the result of an image function. :param expression: A function that receives a dictionary. :param options: Values to add to the function's dictionary, mapping image - names to Image instances. Deprecated. + names to Image instances. Note that the names must be + valid Python identifiers. Deprecated. You can instead use one or more keyword arguments, as - shown in the above example. Note that the names must be - valid Python identifiers. + shown in the above example. + :param **kw: Values to add to the function's dictionary. :return: An image, an integer value, a floating point value, or a pixel tuple, depending on the expression. -.. py:function:: unsafe_eval(expression, options) +.. py:function:: unsafe_eval(expression, options, **kw) Evaluates an image expression. @@ -61,11 +62,12 @@ Example: Using the :py:mod:`~PIL.ImageMath` module :param expression: A string which uses the standard Python expression syntax. In addition to the standard operators, you can also use the functions described below. - :param options: Values to add to the function's dictionary, mapping image - names to Image instances. Deprecated. + :param options: Values to add to the evaluation context, mapping image + names to Image instances. Note that the names must be + valid Python identifiers. Deprecated. You can instead use one or more keyword arguments, as - shown in the above example. Note that the names must be - valid Python identifiers. + shown in the above example. + :param **kw: Values to add to the evaluation context. :return: An image, an integer value, a floating point value, or a pixel tuple, depending on the expression. diff --git a/src/PIL/ImageMath.py b/src/PIL/ImageMath.py index e79eb3ec9b5..191cc2a5f88 100644 --- a/src/PIL/ImageMath.py +++ b/src/PIL/ImageMath.py @@ -251,6 +251,7 @@ def lambda_eval( :param expression: A function that receives a dictionary. :param options: Values to add to the function's dictionary. Deprecated. You can instead use one or more keyword arguments. + :param **kw: Values to add to the function's dictionary. :return: The expression result. This is usually an image object, but can also be an integer, a floating point value, or a pixel tuple, depending on the expression. @@ -295,6 +296,7 @@ def unsafe_eval( :param expression: A string containing a Python-style expression. :param options: Values to add to the evaluation context. Deprecated. You can instead use one or more keyword arguments. + :param **kw: Values to add to the evaluation context. :return: The evaluated expression. This is usually an image object, but can also be an integer, a floating point value, or a pixel tuple, depending on the expression.