Jump to content

  • Log In with Google      Sign In   
  • Create Account


On-the-fly coloring


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Unduli   Members   -  Reputation: 744

Like
0Likes
Like

Posted 18 December 2012 - 10:05 AM

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)

Sponsor:

#2 SuperVGA   Members   -  Reputation: 1118

Like
1Likes
Like

Posted 18 December 2012 - 12:41 PM

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

#3 Unduli   Members   -  Reputation: 744

Like
0Likes
Like

Posted 18 December 2012 - 01:42 PM

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.

#4 SuperVGA   Members   -  Reputation: 1118

Like
2Likes
Like

Posted 18 December 2012 - 03:08 PM

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

#5 Unduli   Members   -  Reputation: 744

Like
0Likes
Like

Posted 20 December 2012 - 03:12 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS