Pixelation

General => General Discussion => Topic started by: Lendrick on December 18, 2013, 07:55:02 pm

Title: Color ramp generator for Dawnbringer 32 palette
Post by: Lendrick on December 18, 2013, 07:55:02 pm
Last night, I coded up a little javascript program to generate color ramps for use with the Dawnbringer 32 palette, which you can find here:

http://static.opengameart.org/gradientifier (http://static.opengameart.org/gradientifier)

The instructions are at the top of the page.  They aren't great, so it's best to play around with the colors and sliders and watch how the gradient changes.  Here are some links to some sample lighting conditions:

* Green grass on a sunny day (http://static.opengameart.org/gradientifier/?co=%2300f518&ch=%23ffffdb&ca=%230e1c4e&r=0&illum=42&hm=7)
* The same color on an overcast day (http://static.opengameart.org/gradientifier/?co=%2300f518&ch=%23ffffff&ca=%23333333&r=0&illum=42&hm=0)
* The same color by moonlight (http://static.opengameart.org/gradientifier/?co=%2300f518&ch=%23203456&ca=%23000000&r=0&illum=76&hm=28)
* The same color under a bright fluorescent light (http://static.opengameart.org/gradientifier/?co=%2300f54a&ch=%23dfedf6&ca=%23536b79&r=0&illum=40&hm=14)

I also made a sample image, just to give people a quick idea of what this tool is capable of.  The tiles used in the sample image were originally designed by Surt (http://opengameart.org/content/puhzil).

(http://i.imgur.com/cSQxCD6.png)
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: astraldata on December 19, 2013, 05:12:43 am
Is there any chance of an offline version of this? Or at least a version that works on a local hard drive?

This is a really useful tool -- I especially like the rainbow tinting ability (I just can't figure out how to select/change other single colors on the rainbow ramp individually).
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: Lendrick on December 19, 2013, 05:47:34 pm
You can download it here:

http://static.opengameart.org/gradientifier.zip (http://static.opengameart.org/gradientifier.zip)

Please note that I can make no guarantee of it working locally.  Browsers have security stuff that sometimes prevents loading of local files onto a canvas.  I don't have any intention of supporting making it work locally, although if someone can write a fix, I'll include it in the download.

As for adjusting the rainbow colors individually, you can't do that yet, although I plan to add that feature.
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: astraldata on December 19, 2013, 07:05:34 pm
Nice! Thanks dude! It seems to work fine locally in Firefox for me. :D

If you update that rainbow version to work with manipulating multiple colors, I would appreciate it if you PM me a zip like this or something because I'd like to use that one locally even more.

It seems like the rainbow thing'd be even more useful to me since the one thing I find tedious in game pixel art is coming up with one general unifying palette to use for everything in a game. Something like this would be awesome for that! At most, I'd just have to do minor tweaks to just a few colors (instead of most or all colors) to get them to exactly where I wanted. That would me save a ton of work dude.

Thanks again for creating this! I can't wait to see the progress you make on the rainbow side! :)
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: Lendrick on December 19, 2013, 07:48:59 pm
Glad to hear it works locally. :)

FYI (if you haven't figured this out already) you can modify rainbow_hex and palette_hex at the top of the file to change the rainbow colors sand the palette.  Ideally I'd also like to add support for other palettes too (it should be fairly trivial), but I'm not sure how well it will work with palettes that have less than 32 colors.  With a 16 color palette, every ramp would have to use basically a third of the entire palette, which doesn't leave much room for variety.

Anyway, I'll let you know once I get the rainbow editing part working.  I might poke at it tonight if I have the chance.
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: Lendrick on December 20, 2013, 10:09:13 pm
Just an update so everyone can see this:  I added the features that astraldata was asking for.  They're available both on the rainbow page and in the updated download.
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: astraldata on December 21, 2013, 06:49:16 am
Awesome man! Thanks a lot! :D Unfortunately though, I think I found a bug... For some reason you can't select the first color, though all the rest appear to be selectable...

Aside from that, I have a slightly more complex, though definitely more useful feature request -- could you let the user change the reflectivity/highlightmultiplier/darken, etc. of JUST the currently-selected color OR all the rainbow colors at once? It'd just require a few more sliders, but it'd make it a LOT easier to control an entire palette as well as individual ramps simultaneously (so you can look and see how they play together side by side as you create 'em).

Also, is there any way to adjust the contrast between the colors on the ramp? If not, I would suggest slider(s) for that as well for those of us who want a little more manual control (both for an individual color, OR the entire rainbow). If you needed to, maybe a toggle switch could work to lock the contrast for the selected color (and use that base contrast to generate that color's ramp using all your other sliders.) This would be ideal when you need some gradients to be 'soft' and others to 'pop'. You could generate a 'hard' OR 'soft' contrast ramp with the Add/remove color command -- but a "duplicate current color" command would be helpful there in the case that you had to have both a soft and a hard version of a color ramp in your palette.

Color selection is a hard thing to come by any good tools for. Even without my new suggestions, this is already shaping up to be an amazing tool for pixel art! If anyone hasn't tried playing around with this yet, they really should. It can almost create any kind of palette they wish. With my new suggestions, it really would be able to! I definitely want to know about any future updates on this! Thanks again for making this dude!
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: Lendrick on December 21, 2013, 04:00:24 pm
Awesome man! Thanks a lot! :D Unfortunately though, I think I found a bug... For some reason you can't select the first color, though all the rest appear to be selectable...

That's actually by design.  The first color is always the tint color, for reference.  If you aren't tinting the whole rainbow, you can just set that color by setting the tint.

Aside from that, I have a slightly more complex, though definitely more useful feature request -- could you let the user change the reflectivity/highlightmultiplier/darken, etc. of JUST the currently-selected color OR all the rainbow colors at once? It'd just require a few more sliders, but it'd make it a LOT easier to control an entire palette as well as individual ramps simultaneously (so you can look and see how they play together side by side as you create 'em).

I like that idea.  I'll see if I can do it.

Also, is there any way to adjust the contrast between the colors on the ramp? If not, I would suggest slider(s) for that as well for those of us who want a little more manual control (both for an individual color, OR the entire rainbow). If you needed to, maybe a toggle switch could work to lock the contrast for the selected color (and use that base contrast to generate that color's ramp using all your other sliders.) This would be ideal when you need some gradients to be 'soft' and others to 'pop'. You could generate a 'hard' OR 'soft' contrast ramp with the Add/remove color command -- but a "duplicate current color" command would be helpful there in the case that you had to have both a soft and a hard version of a color ramp in your palette.

That never actually occurred to me, but it makes a lot of sense.  Right now, all of the gradients always have a color that's as bright as the highlight and as dark as the shadow.  I'll look into adding some kind of contrast slider, both for the whole thing and for individual colors.

Color selection is a hard thing to come by any good tools for. Even without my new suggestions, this is already shaping up to be an amazing tool for pixel art! If anyone hasn't tried playing around with this yet, they really should. It can almost create any kind of palette they wish. With my new suggestions, it really would be able to! I definitely want to know about any future updates on this! Thanks again for making this dude!

I'm really glad you like it.  In all honesty, I kind of built it on a lark and I didn't expect it to work all that well, so I'm as surprised as anyone that the results are so usable, at least with a 32 color palette (I doubt it would work as well with a 16 color palette, or one that's not as designed as well as DB32).  I'm not actually good at color ramps, despite having a rough understanding of how lighting works, so I thought it would be nice to have a program to generate them for me. :)
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: Lendrick on December 21, 2013, 06:23:12 pm
Greets!

Just a heads up, I added what you asked for.  Additionally, I added a Brightness slider (it made sense to add it since I added a contrast slider too).

Just to clear up any potential confusion about the difference between the brightness and illumination sliders:

When you adjust the illumination slider, the brightest and darkest color will always remain the same, and the colors in the middle will get darker and lighter.  A ramp with minimum illumination will be dark, but with a very bright highlight, as if it's backlit by a bright light.

A ramp with minimum brightness will just be very dark.

FYI, I've removed the original zip file and put the code up on Github.  Here's the new download link:

https://github.com/lendrick/Gradientifier/archive/master.zip

Note that the download link is now on the page itself, as well.
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: DARK-SPIRIT on December 22, 2013, 03:44:06 pm
Great, Thank you.
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: astraldata on December 24, 2013, 05:06:47 am
This is an excellent addition dude! Thanks a ton! I'm getting a lot closer to being able to manipulate colors the way I need to.

Unfortunately the one thing I've been having trouble with after this update (and didn't notice before) is that I'm having difficulty maintaining control over an individual color because the Tint/Highlight/Ambient Color Wheels don't affect ONLY the currently selected color, but rather ALL colors together. I admit, when I realized this, I was both happy *and* disappointed simultaneously.

I was happy because you essentially did lighting for me, but I was disappointed because I realized there are entries in the palette I'd rather NOT have controlled by the global ambient/highlight color (i.e. lighting in a level such as a glowing yellow lamp-post light in an otherwise pale moonlit scene).

As amazingly useful as your global lighting system is, stuff like multiple light sources just isn't possible yet and greatly limits the variety of your palette options since you can't choose to have absolute control over the lighting of a single standalone color entry selection (such as the yellow lamplight on a street and grass of the otherwise moonlit level). To combat this, I suggest allowing the *option* of setting the ambient/highlight/tint colors for each individual color selection (a simple checkbox maybe?) so that you can use the *local* (ambient/tint/highlight) settings of the selected color *instead* of the global (ambient/tint/highlight) lighting settings for the entire "rainbow" so one can generate a special, individualized, ramp for any selected color. It would require at least three more color wheels of course + a checkbox or radio-button to determine whether to use the global/local lighting, but if you added them, they would put the cherry on top of this already amazingly-useful tool! :D
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: rikfuzz on December 24, 2013, 10:14:39 am
Pretty amazing - did something similar internally for a game, to pick a nice looking ramp from a base colour, but nothing with so many advanced options! 

For me (in Chrome) the preview isn't updating the mid tone. 
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: Mr. Fahrenheit on December 24, 2013, 02:14:01 pm
Pretty amazing - did something similar internally for a game, to pick a nice looking ramp from a base colour, but nothing with so many advanced options! 

For me (in Chrome) the preview isn't updating the mid tone.

Yeah, I wasn't sure if there was a way to update the preview or not, but I guess its just chrome.
Title: Re: Color ramp generator for Dawnbringer 32 palette
Post by: Ai on December 24, 2013, 10:23:23 pm
I hope to get support for this into GPick (http://code.google.com/p/gpick/) as a Lua 'color filter plugin'. After I build the color filter plugin framework for GPick ;)
I guess this is my way of saying it really impresses me.

The only thing it 'doesn't' do is support quantization to arbitrary palettes , instead of just DB32.