-
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
Add brightness and contrast slider for images #771
Conversation
Summary: Fixes tensorflow#680. Chose to use sliders instead of numeric minimum and maximum window values for ease of use and implementation. Test Plan: Screenshot of the feature in action. ![screenshot using the image demo with decreased brightness and increased contrast](https://user-images.githubusercontent.com/14915474/33226104-974bf2c6-d153-11e7-86bf-2e3c60141e7f.png)
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
@chihuahua mind taking a look at this? (I know @edmundtong and paired this with him (he's interested in contributing to TensorBoard), so I'd like someone else to review it.) |
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.
Sorry for the late response. I am a big fan of this feature.
Could you add a button next to each slider that
- lets the user reset to default settings.
- somehow informs the user if the current settings do not match the default (ie, maybe the button is only active and has an orange outline around it if the current settings do not match the default ones).
step="1" | ||
value="{{_contrastPercentage}}" | ||
immediate-value="{{_contrastPercentage}}" | ||
style="width: 100%;" |
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.
Could we use embedded instead of inline styles? That decouples specifying the HTML from its design and makes it easier to make large-scale design changes.
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.
+1
I like this change. Thank you for sending it to us. |
Thanks! I'll get to this during the weekend. |
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.
Thank you! Just a couple of small nits. Also, could you upload a screenshot?
.resettable-slider-container paper-button { | ||
flex-grow: 0; | ||
} | ||
paper-button[disabled] { |
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.
Could we confine this to only paper-button
s within resettable-slider-container
like the other specifications?
this._brightnessAdjustment = 1; | ||
}, | ||
_resetContrast() { | ||
this._contrastPercentage = 100; |
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.
Could we store the 2 default values in a readOnly
property of the component? ie,
_defaultBrightnessAdjustment: {
type: Number,
value: 1,
readOnly: true,
},
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.
Awesome. Could you rebase to the latest changes and then resolve the conflict?
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Thanks for finishing the merge, Chi! The current state is correct. Is there anything else I should do for this PR? |
@edmundtong, I tried to resolve a merge conflict here and unfortunately triggered the googlebot. Assuming your master branch is up to date, could you try running
and then squashing the merges into the first commit? Then, force push? ie, |
No problem! The edits I made were actually done on GitHub, since my computer has been acting up, and will take a little while to fix, so I'll get to this when I get my computer back up and running. |
@jart, maybe restarting googlebot could work? |
Test Plan: ![image](https://user-images.githubusercontent.com/14915474/33519823-d4f08a9a-d77c-11e7-8145-b5f710b4e976.png) Clicked buttons, saw that they're disabled appropriately and did indeed reset.
Summary: Add default values for brightness and contrast. Modify JavaScript to use those values for reset.
98b97df
to
686edb8
Compare
Thank you, @jart! :) |
Summary:
Fixes #680.
Chose to use sliders instead of numeric minimum and maximum window
values for ease of use and implementation.
Test Plan:
Screenshot of the feature in action.