-
Notifications
You must be signed in to change notification settings - Fork 223
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
[Feature Request] filter by color #37
Comments
Would you like this parameter to be on the random function or somewhere else? Example:
|
Random would probably make most sense.
On Jun 20, 2017 6:36 AM, "Lazo" <notifications@github.com> wrote:
Would you like this parameter to be on the random function or somewhere
else? Example:
pokemon random dark
pokemon random-kanto orange
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APgjsOe8QZYd0OhFAAZS73A58WJpJq7vks5sF8rkgaJpZM4N_K8X>
.
|
The obvious way would be to make a hard-coded list of all 'dark' colored pokemon, gengar, ghastly, kyogre, etc, etc. That would be a unnecessary huge amount of work, and dark is also subjective. Unless we use a 'color palete generator'-ish kinda of library that can detect on runtime how 'dark' a random picked pokemon is and try again if not dark enough and vice versa (for light), but that would be another dependency and @LazoCoder seems very conservative about dependencies. The thing is, with such 'color palete generator' lib we could also implement a pokemon-sensitive color palete setter feature which would be a great great improvement IMO |
Imagemagick is a common dependency for these types of projects. It's not
very heavy to include either. Your might consider that as just about
anything you could ever want to do to an image or a set of colors, Magick
can do.
…On Jun 22, 2017 4:38 AM, "Samuel Henrique" ***@***.***> wrote:
The obvious way would be to make a hard-coded list of all 'dark' colored
pokemon, gengar, ghastly, kyogre, etc, etc.
That would be a unnecessary huge amount, and dark is also subjective,
unless we use a 'color palete generator'-ish kinda of library that can
detect on runtime how 'dark' a random picked pokemon is and try again if
not dark enough and vice versa (for light), but that would be another
dependency and @LazoCoder <https://github.com/lazocoder> seems very
conservative about dependencies. The thing is, with such 'color palete
generator' lib we could also implement a pokemon-sensitive color palete
setter feature which would be a great great improvement IMO
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APgjsKwGr31pzUALGTjR7vJBs0eTy2-Qks5sGlJLgaJpZM4N_K8X>
.
|
I agree completely, not only that i also just remembered issue #6 with could also be implemented with a image magick dependency, IMO we already have more than enough reasons to justify a image magick dependency. |
What would be really cool would be to pick a Pokemon that matches your current wallpaper or Xresources. This would also be fairly easy to acheive using Magick. |
As far as getting a relative "light/dark" value for an image, I found this command: I looped this command over every image currently in the repo, so you can see how different Pokemon compare. Here's a gist. There's a couple options as to how we could use those numbers. We could pick an arbitrary threshold and designate anything below it "dark", and above it "light". We could, say, divide all the numbers by 10 and have people do something like |
Concerning that table though, it may be a bit naive still. For example, Entei is apparently darker than Houndour. Looking around Stack Overflow leads to some formulas like such:
which gives "perceived luminance"/"contrast" according to the W3C accessibility spec. These might be worth looking into for comparison. Update: Sorry, none of these are needed. Magick already applies these values with the option |
Well just using image magick to generate a table like you did would solve the issue without a new dependency. I agree that image magick doesn't hurts, but the less the better. Is your git the latest version of the database? I might give it a shot BTW we don't need the pokemon numbers, they increase one by line. so line number == pokemon number |
Either version of the table there should work. However you should keep the
Pokemon numbers, because at the end of the list are the special mons that
have names instead of numbers.
…On Jun 23, 2017 8:31 AM, "Samuel Henrique" ***@***.***> wrote:
Well just using image magick to generate a table like you did would solve
the issue without a new dependency. I agree that image magick doesn't
hurts, but the less the better. Is your git the latest version of the
database? I might give it a shot BTW we don't need the pokemon numbers,
they increase one by line. so line number == pokemon number
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APgjsDRo5WgBGHtoqE0bWhyII4inAm-Hks5sG9oygaJpZM4N_K8X>
.
|
On second thought, I think that adding in randomization by color might be more complicated than it seems. What if some of the colors are purplish-blue or bluish-green? Those will be hard to label and it can get very subjective even if an algorithm is used. I bet people will open up issues where they believe a certain Pokemon should actually be labelled under another color than what we have labelled it as. Furthermore I can imagine that somebody will want to extend this and request a feature for selecting from multiple colors and more:
This seems like it could get messy to code. Its probably best not to climb down this hole unless we really think this is going to provide immense value to the project. Also, if we do brightness by intensity ( Filtering by light and dark seems like a good, feasible feature though. Generating a pre-computed table seems like the best way to go. Its also best to leave out the custom images from the Extra folder. Since its a pre-computed table, custom images won't be supported for the light/dark functionality. If you do attempt this @samosaara, try to put it in its own class like ColorDatabase.py and have methods like:
This way if we actually do decide to add support for colors it will be easier to put them in. |
The gist above is effectively a pre-compiled table of light/darkness values. If you'd like I can convert it into CSV or JSON or some other format. The only thing left is to decide what the threshold of light or dark is. Some examples:
|
My suggestion for now would be just two lists, |
Sounds good to me. Just so you know, I've updated the images with a different compression algorithm. You may want to run your script on the new images (I don't know if it will make a difference, but just in case). |
Alright.
I've forked the repo to make changes, I should have this feature
implemented in a few hours when I get home.
…On Jun 24, 2017 1:08 PM, "Lazo" ***@***.***> wrote:
Sounds good to me.
Just so you know, I've updated the images with a different compression
algorithm. You may want to run your script on the new images (I don't know
if it will make a difference, but just in case).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APgjsIj1jUqWlfKH4EwryyRIzGdvWRJYks5sHWy0gaJpZM4N_K8X>
.
|
With the work that I'm now doing on #6 I think I've got a general idea for how we might do generic color filtering in the future. The simplest way would just be to list one or two primary colors for each Pokemon and use imagemagick to find the primary color of the users wallpaper or current terminal background color, and just pick the closest image. |
I just had an epiphany, how about, instead of simply random color filtering... Pokemon type filtering?! Which in turn also has colors?! 😃 And we don't even need image magick?!? But there are obvious drawbacks, first type isn't really a synonym of color, e.g. mudkip is also ground type, and it's blue, and like in my first example, some pokemon have multiple types, and third, some pokemon break the convention coff-coff, arceus, coff-coff But I still think is a reliable ruler anyway! Mostly electric are yellow, mostly grass type are green, so on and so forth. But i'm not saying the ideas are mutually exclusive, I just thought it was a better alternative, but if you think it is not reliable enough as a color filter I will implement it anyway. |
That could be separate I think. |
Okay so if anyone still wants to implement this, we could do basically the same we did with the lightness index, just generate the main color for all pokemon with some external tool, and keep the main colors in the database, it's also static data anyway. But since colors are just a hex code I was thinking to set some named color ranges, like a range of blue-ish hex codes and every pokemon that should fall in that range would be labeled 'blue', so on and so forth. And don't bother with lightness, that would be redundant, every blue dark or light should just be blue, then if he wants dark blue, he will just mix with the darkness filter. Something to keep in mind is, is pretty much a consensus that we will change the database from plain text to JSON soon, so such change should wait for that. |
I could possibly get back into working on this. |
Can we get something like a color parameter? I really really really love this project you have no idea. My xinitrc spawns a random Pokemon on my wallpaper every boot and my config.fish gives a random Pokemon to each terminal. Maybe it's just a phase but this never ceases to bring me joy. My eyes, however, do not appreciate the sudden burst of yellow Pikachu or white Arceus when they've adjusted to Giratina or Skuntank. At the very least, a parameter to specify "light" or "dark" would be greatly appreciated.
The text was updated successfully, but these errors were encountered: