From 936bf089c15d7ac9a6b509e2d56de5d8a5806bb0 Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sat, 14 Nov 2026 12:57:30 +0000 Subject: [PATCH 1/3] Update various methods as Pro only --- pyimgproxy/image.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pyimgproxy/image.py b/pyimgproxy/image.py index 22bb691..e851f36 100644 --- a/pyimgproxy/image.py +++ b/pyimgproxy/image.py @@ -111,6 +111,8 @@ def resizing_type(self, resizing_type: str) -> "Image": def resizing_algorithm(self, resizing_algorithm: str) -> "Image": """ + This option is only available in imgproxy Pro. + Defines the algorithm that imgproxy will use for resizing. Supported algorithms are `nearest`, `linear`, `cubic`, `lanczos2`, and `lanczos3`. @@ -368,6 +370,8 @@ def background( def background_alpha(self, alpha: int | float) -> "Image": """ + This option is only available in imgproxy Pro. + Adds an alpha channel to `background`. The value of `alpha` is a positive floating point number between `0` and `1`. @@ -382,6 +386,8 @@ def adjust( saturation: int | float | None = None, ) -> "Image": """ + This option is only available in imgproxy Pro. + This is a meta-option that defines the brightness, contrast, and saturation. All arguments are optional and can be omitted to use their default values. """ @@ -389,6 +395,8 @@ def adjust( def brightness(self, brightness: int) -> "Image": """ + This option is only available in imgproxy Pro. + When set, imgproxy will adjust brightness of the resulting image. `brightness` is an integer number ranging from `-255` to `255`. @@ -398,6 +406,8 @@ def brightness(self, brightness: int) -> "Image": def contrast(self, contrast: int | float) -> "Image": """ + This option is only available in imgproxy Pro. + When set, imgproxy will adjust the contrast of the resulting image. `contrast` is a positive floating point number, where a value of `1` leaves the contrast unchanged. @@ -407,6 +417,8 @@ def contrast(self, contrast: int | float) -> "Image": def saturation(self, saturation: int | float) -> "Image": """ + This option is only available in imgproxy Pro. + When set, imgproxy will adjust saturation of the resulting image. `saturation` is a positive floating-point number, where a value of `1` leaves the saturation unchanged. @@ -451,6 +463,8 @@ def unsharp_masking( divider: int | float | None = None, ) -> "Image": """ + This option is only available in imgproxy Pro. + Allows redefining unsharp masking options. All arguments have the same meaning as Unsharp masking configs. All arguments are optional and can be omitted. """ @@ -458,6 +472,8 @@ def unsharp_masking( def blur_detections(self, sigma: int | float, class_names: list[str] | None = None) -> "Image": """ + This option is only available in imgproxy Pro. + imgproxy detects objects of the provided classes and blurs them. If class names are omitted, imgproxy blurs all the detected objects. @@ -469,6 +485,8 @@ def blur_detections(self, sigma: int | float, class_names: list[str] | None = No def draw_detections(self, draw: bool, class_names: list[str] | None = None) -> "Image": """ + This option is only available in imgproxy Pro. + When draw is set to `True`, imgproxy detects objects of the provided classes and draws their bounding boxes. If class names are omitted, imgproxy draws the bounding boxes of all the detected objects. @@ -573,6 +591,8 @@ def format(self, extension: str) -> "Image": def page(self, page: int) -> "Image": """ + This option is only available in imgproxy Pro. + When a source image supports pagination (PDF, TIFF) or animation (GIF, WebP), this option allows specifying the page to use. Page numeration starts from zero. @@ -586,6 +606,8 @@ def page(self, page: int) -> "Image": def pages(self, pages: int) -> "Image": """ + This option is only available in imgproxy Pro. + When a source image supports pagination (PDF, TIFF) or animation (GIF, WebP), this option allows specifying the number of pages to use. The pages will be stacked vertically and left-aligned. @@ -600,6 +622,8 @@ def pages(self, pages: int) -> "Image": def disable_animation(self, disable: bool) -> "Image": """ + This option is only available in imgproxy Pro. + When set to `True`, imgproxy will treat all images as not animated. Use the `page` and the `pages` options to specify which frames imgproxy should use. From 5a16a8ecc9ae111b656cb1c19f7637625a674915 Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sat, 14 Nov 2026 12:56:51 +0000 Subject: [PATCH 2/3] Update docstrings for gravity types --- pyimgproxy/image.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyimgproxy/image.py b/pyimgproxy/image.py index e851f36..5fab3f3 100644 --- a/pyimgproxy/image.py +++ b/pyimgproxy/image.py @@ -207,8 +207,9 @@ def extend( """ - When extend is set to `True`, imgproxy will extend the image if it is smaller than the given size. - - `gravity_type` (optional) accepts the same values as the gravity option, except `sm`. - When `gravity` is not set, imgproxy will use `ce` gravity without offsets. + - `gravity_type` (optional) accepts the same values as the gravity option, except `sm`, + `obj` and `objw`. When `gravity_type` is not set, imgproxy will use `ce` gravity without + offsets. Default: `false:ce:0:0` """ @@ -224,8 +225,9 @@ def extend_aspect_ratio( """ - When extend is set to `True`, imgproxy will extend the image to the requested aspect ratio. - - `gravity_type` (optional) accepts the same values as the gravity option, except `sm`. - When `gravity_type` is not set, imgproxy will use `ce` gravity without offsets. + - `gravity_type` (optional) accepts the same values as the gravity option, except `sm`, + `obj` and `objw`. When `gravity_type` is not set, imgproxy will use `ce` gravity without + offsets. Default: `false:ce:0:0` """ From 56dae1f600a926ec366933c82ac0a14791c61fc3 Mon Sep 17 00:00:00 2001 From: Alex Tomkins Date: Sat, 14 Nov 2026 12:57:23 +0000 Subject: [PATCH 3/3] Add trim memory warning --- pyimgproxy/image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyimgproxy/image.py b/pyimgproxy/image.py index 5fab3f3..761dc6a 100644 --- a/pyimgproxy/image.py +++ b/pyimgproxy/image.py @@ -294,6 +294,10 @@ def trim( """ Removes surrounding background. + Trimming requires an image to be fully loaded into memory. This disables scale-on-load and + significantly increases memory usage and processing time. Use it carefully with large + images. + - `threshold` - color similarity tolerance. - `color` - (optional) a hex-coded value of the color that needs to be cut off. - `equal_hor` - (optional) set to `True`, imgproxy will cut only equal parts from left and