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

Fix limited brush colors in image editor #9234

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

maggieNeedsZzz
Copy link

Description

Related to: #8102

Removes the hardcoded limit of 4 colors in the brush color swatch in the image editor. It now supports displaying all available colors which automatically wrap to new rows by using flex-wrap: wrap.

new_brush

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Sep 2, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/cc8631bf85dcebe9c1b197d0d9769d77c92709e1/gradio-4.44.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@cc8631bf85dcebe9c1b197d0d9769d77c92709e1#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/cc8631bf85dcebe9c1b197d0d9769d77c92709e1/gradio-client-1.5.2.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/cc8631bf85dcebe9c1b197d0d9769d77c92709e1/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Sep 2, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/imageeditor minor
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Fix limited brush colors in image editor

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@pngwn
Copy link
Member

pngwn commented Sep 2, 2024

I'm not sure about this. I understand the desire but don't know if this is the right UX. at the very least the CSS needs some tweaking to clean up the padding.

What do you think @hannahblair?

@maggieNeedsZzz
Copy link
Author

maggieNeedsZzz commented Sep 9, 2024

Sorry, UX is not something I usually do. I can match the top margin to the bottom one. Is there anything else I should do?

@maggieNeedsZzz
Copy link
Author

I know this is a small change, so I'll provide some context.

I was trying to use the image editor for drawing a semantic label image.
I have a model trained for semantic synthesis, a task which can be described as generating photorealistic images from semantic layouts. Typically, these layouts are user-drawn, similar to what can be seen in NVIDIA Canvas.

Popular datasets used to train models for this task like COCO-Stuff, Cityscapes, and ADE20K, make use of more than 4 labels in the semantic image, meaning more than 4 colors.

Therefore, the current limit on the number of brush colors makes using this component for this particular task very difficult.

I've looked for potential workarounds but couldn't find any. Apologies if I've missed something.

@pngwn
Copy link
Member

pngwn commented Sep 13, 2024

Hey! Totally understand the use case and sorry it's taken us so long to get back to you! We've been a little busy planning the upcoming release. I think @hannahblair is gonna take a closer look at this as soon as possible!

Thanks again for submitting the PR and sorry for the delay!

@abidlabs abidlabs marked this pull request as draft October 7, 2024 17:30
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.

4 participants