Skip to content

Allow custom background colors for image rotation - #302

Open
Aschenbath wants to merge 1 commit into
PyImageSearch:masterfrom
Aschenbath:codex/oss20-20261122-de52-imutils-border
Open

Aschenbath wants to merge 1 commit into
PyImageSearch:masterfrom
Aschenbath:codex/oss20-20261122-de52-imutils-border

Conversation

@Aschenbath

Copy link
Copy Markdown

Add an optional border_value argument to rotate and rotate_bound and pass it to OpenCV. Existing calls retain the default black background; grayscale scalar colors and BGR color tuples can now fill the exposed corners. Document both forms.

Fixes #188.

Validation: Real OpenCV tests cover grayscale and color images, both rotation helpers, unchanged defaults, unchanged input arrays, output shape/dtype, and custom center/scale. The tests fail before the change and pass after it.

Developed with AI assistance; the changes and validation results were reviewed before submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Background colour on rotate

1 participant