Skip to main content
Topic: Automatic adding of player colours (Read 28564 times) previous topic - next topic

Automatic adding of player colours

Still working on this, but here is a preview of possible tool. It will process png files given as parameters and recolorize according to options.cfg in same folder as image.

http://files.[ simutrans [dot] us (site down, do not visit) ]/files/get/Oxqw_T3Xnu/recolorer.7z

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

 

Re: Automatic adding of player colours

Reply #1
Sounds interesting.  Have I understood this tool correctly, i.e. could be used as follows?

1) render image in, say, black and pink
2) use tool to convert pink to player colour, black stays the same?

And does this work for 2 player colours?

This may solve the long-standing request for pak128.Britain vehicles in player colours without too much fuss...

Re: Automatic adding of player colours

Reply #2
Currently it works like this:

For every pixel,
    store current colour as best result but with high metric
    for every candidate colour,
        find metric
        and if metric is bettter than best result,
            store this result as best
    finally, replace original colour with the best result


metric is Euclidian distance in rgb space



Zeno has worked out a better (more automatic) workflow for Blender, so you might want to give that a test instead. It's based on taking the normal render (w. OSA) and masking with non-osa & shadeless render...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Re: Automatic adding of player colours

Reply #3
I found that sqrt(r*r*2 + g*g*3 + b*b) often is closer to what human eye sees as "similar" colors than unbiased euclidean distance in rgb space.

Re: Automatic adding of player colours

Reply #4
Zeno has worked out a better (more automatic) workflow for Blender, so you might want to give that a test instead. It's based on taking the normal render (w. OSA) and masking with non-osa & shadeless render...
Actually I have a small app that is strictly based in my working workflow, thus is only applicable to that way of working and it hasn't any flexibility at the moment.
As VS explains, this way of doing things is based on mask and osa renders. If anyone wants more info on it contact me via PM or the IRC chat (or just post here).