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

Shrink color space #23

Open
AntonBiryukovUofC opened this issue Jul 16, 2021 · 3 comments
Open

Shrink color space #23

AntonBiryukovUofC opened this issue Jul 16, 2021 · 3 comments

Comments

@AntonBiryukovUofC
Copy link

AntonBiryukovUofC commented Jul 16, 2021

Hello @BachiLi , thanks for this awesome contribution!

I was wondering if you could give me a hint how to modify your code a bit. I was hoping to try out you painterly rendering app for sketching applications, and am not sure how to modify it to incorporate few things:

a) Remove the opacity before loss calculation / as a parameter. Sketching is done often with one pencil whose alpha is pretty much always 1.
b) An artist doing sketching usually has a constrained discrete palette to operate with (often with just black pencil / pen). It would be lovely to know how to constrain stroke colors to a specific palette (or rgb subspace)

I think I solved a) via:

         for group in shape_groups:
                group.stroke_color.data.clamp_(0.0, 1.0)
                #Limit the opactiy
                group.stroke_color.data[3].clamp_(1.0, 1.0))

Thanks in advance,

Anton.

@AntonBiryukovUofC
Copy link
Author

Here's the desired outcome example:
https://openprocessing.org/sketch/486307/

@AntonBiryukovUofC
Copy link
Author

image

@dribnet
Copy link

dribnet commented Aug 13, 2021

I'm also interested in color constraints. Specifically, I currently would like to setup a system using indexed color and then allow the system to optimise both the palette and with the color assignments of individual elements. Conceptually this seems possible through optimisation using an embedding or even just argmax across multiple scalar tensors each representing possible indexes into color table - but I haven't been able to code this up successfully thus far and would be interested in sharing notes.

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

No branches or pull requests

2 participants