Proof of concept. This is hue replacement; he example is the two hues swapped, would have to figure out an appropriate method to work in saturation/lightness of a team color. Since one of the base colors is yellow, I don't think it's possible to avoid the construction stripes without an image-specific exclusion area.
Hueswap is possible when isolating team colored regions, beware of color bleeding or other occlusion effects. Same goes for saturation, well, at least partly since bit depth isn't sufficient to fully avoid color banding. Brightness is impossible to scale this way. There is just no math which would allow you to do that, since lightning is applied after the color is determined, not before.
Wow, I didn't expect my little suggestion to explode like this. For black and white, It seems that the easiest way to create the conversion would be to filter the team color areas of the image to greyscale, and then applying a transformation which compresses the "before" full gray range into the brightest and darkest 40% of the grayscale spectrum. Making it look good as pure black would be insanely difficult without the raw render data, but compromising with very light and dark grays would make passable and recognisable equivilants.
Those were rather tricky. I believe my solution can best be described as weighting between a L^2 and sqrt(L) curve, where L = lightness in HSL space. Meanwhile, secondary color isn't available on the cinematic screen without further hacking, so I had to use gray.
Wow, even without secondary color that's stunning! Will the main menu commander be randomly recolored too?
That's what it currently does, as much for testing as anything; albeit with a delay - can't really do anything until the image loads and they are large - 1780^2
what if you photo shopped every image that every base color was bright pink and every secondary was bright orange and had it fixed that it knew bright pink was the base color and bright orange was secondary instead of having to do it on a case to case basis that may cause problems depending on what the base image is
I don't want to do the image editing (now and as each commander is released) and I'd rather not include a ton of images in the mod either.
Test version on github. It's not a cheap operation and there well be visual hiccups - trying again with webgl shaders is left as an exercise for the reader. https://github.com/JustinLove/commander_image_color Known pixel issues that could use refinement of selection or replacement: - Centurion shoulder - Nemicus highlights - Rallus chest - Theta inner surfaces/edges
Looks really cool, very well done Of course, nitpicky as I am ( ), I noticed some "pixel party" areas on the main screen : Spoiler: Spoiler But I can live with it Quick question : Would it be possible (if it's easy enough) to read Favourite Colour's mod preference (if mounted) and apply primary colour set (or a random between primary and secondary set) instead of completely random colours for the start screen ?
Yeah, I haven't tried hacking in any of the extended commander images. Almost certainly; I've expected that would be an enhancement at some point, but I've already spent too much time on this for the current week.
No pressure, it's already awesome as it is, and the request from @Prezombie was done only yesterday ! Great work, as usual
Goodness me wow, the little pixel errors are totally forgivable given this amazing job. Thank you so much, I was getting so tired of the bland blue/orange portraits!