On-the-fly coloring

Started by
3 comments, last by Unduli 11 years, 3 months ago
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)

mostates by moson?e | Embrace your burden

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. :)
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.

mostates by moson?e | Embrace your burden

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! :)
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.

mostates by moson?e | Embrace your burden

This topic is closed to new replies.

Advertisement