GeezerVison is showing github.com — feat(studio_shot): add enhance + enhance_strength params; bump 0.5.0 · useknockout/python@d30c25c
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: README.md +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -97,6 +97,7 @@ c.outline("photo.jpg", outline_color="#000000", outline_width=4) | 97 | 97 | # Presets | 98 | 98 | c.studio_shot("photo.jpg", aspect="1:1", shadow=True) # e-commerce | 99 | 99 | c.studio_shot("photo.jpg", transparent=True) # transparent bg (PNG) | | 100 | +c.studio_shot("photo.jpg", enhance=True) # brightness + saturation lift | 100 | 101 | c.headshot("photo.jpg", bg_color="#FFFFFF") # LinkedIn 4:5 portrait | 101 | 102 | c.headshot("photo.jpg", bg_blur=True, blur_radius=24) # blurred original bg | 102 | 103 |
| |
Collapse file Copy file name to clipboardExpand all lines: pyproject.toml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build" | 4 | 4 |
| 5 | 5 | [project] | 6 | 6 | name = "useknockout" | 7 | | -version = "0.4.0" | | 7 | +version = "0.5.0" | 8 | 8 | description = "Python SDK for useknockout — state-of-the-art background removal API." | 9 | 9 | readme = "README.md" | 10 | 10 | license = { text = "MIT" } | |
Collapse file Copy file name to clipboardExpand all lines: src/useknockout/async_client.py +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -259,6 +259,8 @@ async def studio_shot( | 259 | 259 | padding: int = 48, | 260 | 260 | shadow: bool = True, | 261 | 261 | transparent: bool = False, | | 262 | + enhance: bool = False, | | 263 | + enhance_strength: float = 0.15, | 262 | 264 | format: str = "jpg", | 263 | 265 | ) -> bytes: | 264 | 266 | return await self._request_bytes( | @@ -272,6 +274,8 @@ async def studio_shot( | 272 | 274 | "padding": padding, | 273 | 275 | "shadow": shadow, | 274 | 276 | "transparent": transparent, | | 277 | + "enhance": enhance, | | 278 | + "enhance_strength": enhance_strength, | 275 | 279 | "format": format, | 276 | 280 | } | 277 | 281 | ), | |
Collapse file Copy file name to clipboardExpand all lines: src/useknockout/client.py +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -284,12 +284,18 @@ def studio_shot( | 284 | 284 | padding: int = 48, | 285 | 285 | shadow: bool = True, | 286 | 286 | transparent: bool = False, | | 287 | + enhance: bool = False, | | 288 | + enhance_strength: float = 0.15, | 287 | 289 | format: str = "jpg", | 288 | 290 | ) -> bytes: | 289 | 291 | """POST /studio-shot — e-commerce preset (cutout + crop + center + shadow). | 290 | 292 |
| 291 | 293 | Set ``transparent=True`` to keep a transparent background (bg_color and | 292 | 294 | shadow are ignored; output is PNG, jpg is coerced). | | 295 | +
| | 296 | + Set ``enhance=True`` for a subtle brightness + saturation lift on the | | 297 | + subject (ecommerce-ready). ``enhance_strength`` (0.0-0.5, default 0.15) | | 298 | + controls the amount and only applies when ``enhance`` is True. | 293 | 299 | """ | 294 | 300 | return self._request_bytes( | 295 | 301 | "POST", | @@ -302,6 +308,8 @@ def studio_shot( | 302 | 308 | "padding": padding, | 303 | 309 | "shadow": shadow, | 304 | 310 | "transparent": transparent, | | 311 | + "enhance": enhance, | | 312 | + "enhance_strength": enhance_strength, | 305 | 313 | "format": format, | 306 | 314 | } | 307 | 315 | ), | |
|