• Advertisement
Sign in to follow this  

On-the-fly coloring

This topic is 1856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello there o/,

I searched forum and web but can't say it was fruitful probably thanks to keywords I used. So apologies if this is a common one.

I just wondered what would you recommend for coloring assets for a web based game. I mean is it possible to have for example a guy sprite and using this to have guy with blue, green, red ... shirt? Or a single house and color it as I please.

I think of a 'colouring map' which stores values of 'proximity' to base color and calculate values on-the-fly. Is it a right approach?

Thanks in advance and apologies for terrible writing style (if any)

Share this post


Link to post
Share on other sites
Advertisement
It's a pain to get running, but i colourize stuff on the fly with imagick plugin for php when using that.
If you run asp.net, it's easy to create a generic handler, for instance, to handle these things.
Another time i used a simple c library, cimg, to create a set of colourized spritrs once, and then pick from later.
If you do need to generate on the fly, It's cool if you set up some sort of server-side caching if you use the same colour combinations often.

I like libraries that allow me to lock an image into a series of bytes,
after which i can modify it as much as i like. I stick with levels of red, from black to red, and then increasing on g and b afterwards, as source. Makes it easy to view the originals.

I'd like to elaborate once I've got a hardware keyboard in front of me. :)

Share this post


Link to post
Share on other sites
Thanks for caring to reply, SuperVGA.

Well, what worries me is the number of sprites multiplied with zoom levels , it may take a relatively long while to load , it was actually why I thought of dynamic coloring.

Btw, I was more interested in a javascript solution combined with localstorage if available. But a server side solution may be a matter of debate.

Share this post


Link to post
Share on other sites
I suggest storing a few resolutions of a sprite server side,
Leaving the client to scale, downsample them. Client-side stuff can be cool, but unless you have a cross browser foundation,
It easily becomes a bitch of a challenge. Store an atlas of the coloured sprites, so your server can take some time off as soon as possible.

I'd perhaps do some neat scaling and opacity effects with jquery and css3 pie,
but empathise correct, smooth translations and keeping effects to a minimum.
Particle effects with premade emissions go a long way.

But I don't know what you want to do in the bigger picture.
-Maybe your requirements say "webkit only" -and you can worry less! :)

Share this post


Link to post
Share on other sites
Well, seems I will find a hybrid solution to ensure acceptable load time and small memory print.

And I intend on high cross-browser compatibility to eliminate requirement of apps for each platform, this will be a challenge for sure.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement