Skip to content
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

Merged
merged 5 commits into from
Jan 5, 2018

Conversation

edmundtong
Copy link
Contributor

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.
screenshot using the image demo with decreased brightness and increased contrast

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)
@googlebot
Copy link

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!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@edmundtong
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@wchargin wchargin removed their request for review November 25, 2017 01:31
@wchargin
Copy link
Contributor

wchargin commented Nov 25, 2017

@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.)

Copy link
Member

@chihuahua chihuahua left a 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

  1. lets the user reset to default settings.
  2. 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%;"
Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@jart
Copy link
Contributor

jart commented Nov 28, 2017

I like this change. Thank you for sending it to us.

@edmundtong
Copy link
Contributor Author

Thanks! I'll get to this during the weekend.

Copy link
Member

@chihuahua chihuahua left a 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] {
Copy link
Member

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-buttons within resettable-slider-container like the other specifications?

this._brightnessAdjustment = 1;
},
_resetContrast() {
this._contrastPercentage = 100;
Copy link
Member

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,
},

@edmundtong
Copy link
Contributor Author

Screenshot: image

Copy link
Member

@chihuahua chihuahua left a 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?

@googlebot
Copy link

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 cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@edmundtong
Copy link
Contributor Author

Thanks for finishing the merge, Chi! The current state is correct. Is there anything else I should do for this PR?

@chihuahua
Copy link
Member

chihuahua commented Dec 23, 2017

@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

git rebase -i master

and then squashing the merges into the first commit? Then, force push? ie, git push --force. Sorry about that. :(

@edmundtong
Copy link
Contributor Author

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.

@chihuahua
Copy link
Member

@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.
@edmundtong edmundtong force-pushed the image-brightness-contrast branch from 98b97df to 686edb8 Compare December 26, 2017 15:02
@jart jart merged commit d46f60f into tensorflow:master Jan 5, 2018
@chihuahua
Copy link
Member

Thank you, @jart! :)

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

Successfully merging this pull request may close these issues.

5 participants