useknockout 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: useknockout
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: Python SDK for useknockout — state-of-the-art background removal API.
5
5
  Project-URL: Homepage, https://useknockout.com
6
6
  Project-URL: Documentation, https://github.com/useknockout/python
@@ -128,6 +128,7 @@ c.outline("photo.jpg", outline_color="#000000", outline_width=4)
128
128
 
129
129
  # Presets
130
130
  c.studio_shot("photo.jpg", aspect="1:1", shadow=True) # e-commerce
131
+ c.studio_shot("photo.jpg", transparent=True) # transparent bg (PNG)
131
132
  c.headshot("photo.jpg", bg_color="#FFFFFF") # LinkedIn 4:5 portrait
132
133
  c.headshot("photo.jpg", bg_blur=True, blur_radius=24) # blurred original bg
133
134
 
@@ -96,6 +96,7 @@ c.outline("photo.jpg", outline_color="#000000", outline_width=4)
96
96
 
97
97
  # Presets
98
98
  c.studio_shot("photo.jpg", aspect="1:1", shadow=True) # e-commerce
99
+ c.studio_shot("photo.jpg", transparent=True) # transparent bg (PNG)
99
100
  c.headshot("photo.jpg", bg_color="#FFFFFF") # LinkedIn 4:5 portrait
100
101
  c.headshot("photo.jpg", bg_blur=True, blur_radius=24) # blurred original bg
101
102
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "useknockout"
7
- version = "0.2.0"
7
+ version = "0.3.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" }
@@ -0,0 +1 @@
1
+ __version__ = "0.3.0"
@@ -250,6 +250,7 @@ class AsyncKnockout:
250
250
  aspect: str = "1:1",
251
251
  padding: int = 48,
252
252
  shadow: bool = True,
253
+ transparent: bool = False,
253
254
  format: str = "jpg",
254
255
  ) -> bytes:
255
256
  return await self._request_bytes(
@@ -262,6 +263,7 @@ class AsyncKnockout:
262
263
  "aspect": aspect,
263
264
  "padding": padding,
264
265
  "shadow": shadow,
266
+ "transparent": transparent,
265
267
  "format": format,
266
268
  }
267
269
  ),
@@ -274,9 +274,14 @@ class Knockout:
274
274
  aspect: str = "1:1",
275
275
  padding: int = 48,
276
276
  shadow: bool = True,
277
+ transparent: bool = False,
277
278
  format: str = "jpg",
278
279
  ) -> bytes:
279
- """POST /studio-shot — e-commerce preset (cutout + crop + center + shadow)."""
280
+ """POST /studio-shot — e-commerce preset (cutout + crop + center + shadow).
281
+
282
+ Set ``transparent=True`` to keep a transparent background (bg_color and
283
+ shadow are ignored; output is PNG, jpg is coerced).
284
+ """
280
285
  return self._request_bytes(
281
286
  "POST",
282
287
  "/studio-shot",
@@ -287,6 +292,7 @@ class Knockout:
287
292
  "aspect": aspect,
288
293
  "padding": padding,
289
294
  "shadow": shadow,
295
+ "transparent": transparent,
290
296
  "format": format,
291
297
  }
292
298
  ),
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
File without changes
File without changes