MCPcopy Create free account
hub / github.com/openai/plugins / crop_to_content

Function crop_to_content

plugins/game-studio/scripts/normalize_sprite_strip.py:62–66  ·  view source on GitHub ↗
(image: Image.Image, alpha_threshold: int)

Source from the content-addressed store, hash-verified

60
61
62def crop_to_content(image: Image.Image, alpha_threshold: int) -> Image.Image | None:
63 bbox = threshold_bbox(image, alpha_threshold)
64 if bbox is None:
65 return None
66 return image.crop(bbox)
67
68
69def split_strip(strip: Image.Image, frames: int) -> list[Image.Image]:

Callers 2

load_anchorFunction · 0.85
mainFunction · 0.85

Calls 1

threshold_bboxFunction · 0.85

Tested by

no test coverage detected