-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update posterize #2180
Update posterize #2180
Conversation
Reviewer's Guide by SourceryThis PR updates the posterize transformation to improve its implementation and documentation. The main changes include limiting the bit range to 1-7 (removing the option for 8 bits), adding support for channel-specific bit reduction, and enhancing the documentation with detailed explanations and examples. Updated class diagram for the Posterize transformationclassDiagram
class Posterize {
- num_bits: int | tuple[int, int] | list[int] | list[tuple[int, int]]
+ apply(img: np.ndarray, num_bits: Literal[1, 2, 3, 4, 5, 6, 7] | list[Literal[1, 2, 3, 4, 5, 6, 7]], **params: Any) np.ndarray
+ get_params() dict[str, Any]
}
note for Posterize "Updated to support channel-specific bit reduction and limit bit range to 1-7"
Updated class diagram for the posterize functionclassDiagram
class posterize {
+ posterize(img: np.ndarray, bits: Literal[1, 2, 3, 4, 5, 6, 7] | list[Literal[1, 2, 3, 4, 5, 6, 7]]) np.ndarray
}
note for posterize "Function updated to support channel-specific bit reduction and limit bit range to 1-7"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ternaus - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2180 +/- ##
=========================================
+ Coverage 0 89.75% +89.75%
=========================================
Files 0 47 +47
Lines 0 8431 +8431
=========================================
+ Hits 0 7567 +7567
- Misses 0 864 +864 ☔ View full report in Codecov by Sentry. |
Summary by Sourcery
Enhance the 'posterize' function to support per-channel bit reduction and restrict the bit range to [1, 7] for more consistent effects.
Enhancements: