Dyeing/Colorizing Unit Images
-
@redrum Red this would be a very valuable tool for a map maker who may not be a superior graphics manipulator...
The only thing I would suggest (having just a wee little bit of experience making a couple units) is that would it not be better to have all units start with a sepia finsh rather than grayscale?
-
I like this idea. Like @Cernel says, it might not be that difficult to make copies of each, it still takes time that I would rather use figuring out my map. At least early on.
Even if all it does is make it the same as the map fill in color for a country, it will work for testing purposes, but then I can make good colors for them later on.
-
@Hepps said in Dyeing/Colorizing Grayscale Unit Images:
The only thing I would suggest (having just a wee little bit of experience making a couple units) is that would it not be better to have all units start with a sepia finsh rather than grayscale?
@redrum Correct. I overlooked you are using the Germans, that is grey, units. What I said at my previous post, about using "Hue-Saturation" changes instead of colourizing, assumes that you, instead, use actually coloured units as basis. So, don't use the Germans or the Neutral, as grey units are just pictures having no saturation at all (actually, I checked the Germans infantry in assets, and that is not actually grey, but an almost totally desaturated sky blue, that looks like grey), but use anything else, instead (it doesn't matter the starting colour). Rather than sepia (that is British, I guess), I'd use pure red (that is Russians), as that is conventionally the hue 0 on the colour scale.
Still advising not making this at all, by the way, but looks like I'm the only one having problems with this feature.
-
Also, since this is going to be something for more than basic maps, maybe this can be made as a single map.properties Boolean switch that applies the hue and saturation of the ownership colours to the units too (this way, it would not only assure all units having the same hue, for the same player, but also being exactly the same as the ownership colourization).
-
Thanks for all the feedback. I'm going to lay out the high level design and things I'm planning to include along with this feature.
@Black_Elk I will mostly likely update some existing maps to take advantage of various parts of this feature especially any maps that truly have all monocolored units. I believe it would be possible to grab all sea zones and apply some sort of colorization but would have to think a bit about it and how it works with reliefs.
@LaFayette I'm sure you'll see the code soon
I'm mostly doing something similar to what GIMP and other image tools do around a colorize function. It essentially finds the luminance of each pixel of the base image then sets the pixels of the new image based on the specified hue/saturation/brightness and that calculated luminance value.@Hepps I believe it should work fine with any base image color that is far from white/black.
@Cernel This feature will mostly be geared towards map makers that have limited graphical ability or as a shortcut to get started not for complex/advanced map makers that already are comfortable colorizing images. And yes, this will only work well for units that are monocolor so you'll have to live with that or colorize some of the images yourself if you want a perfect map. Generally, you don't want unit images to be the exact same color as territory color so I think its better to have a separate color value for each nation for their units. I think the rest of your comments will be addressed below.
Overview
- Add ability for engine to colorize images. This will take a color code (only apply its hue and saturation) or take a HSB value (apply all 3 values, increasing brightness is often not ideal so kind of an advanced use at your own risk). It also ignores any pixels that are close to black (brightness < 10%) as especially if increasing brightness these get faded and make images look less sharp.
- Add ability to place unit images in unit folder directly which are then shared across all nations (it will first check for an image in the nation folder and if not found then check the unit folder and then check the images included with TripleA). This will allow flexibility if not all units can be shared or aren't monocolored.
- Add new properties to map.properties:
- A color or HSB value - apply to unit images for each nation (this will be applied to ALL units of that nation unless exempt). This will allow map makers to potentially use a single set of unit images and specify colors for each nation. Also allow users to override the default unit image color just like they can for territory colors.
- A list of units exempt from colorization - this could include things like factories that are the same color for all nations or units that were already colorized by hand for each nation like AA radar or damaged battleships
-
@redrum said in Dyeing/Colorizing Grayscale Unit Images:
@Black_Elk I will mostly likely update some existing maps to take advantage of various parts of this feature especially any maps that truly have all monocolored units.
I'm not sure what you intend to do here. Most maps with monocoloured units (if we forget about the hit and aa radar images) have units differing only for colourization and unit that are actually different. For example, in assets, there is the same battleship image, with different colourization, for all players, but each player has its own submarine image. I'm curious what you intend to do and on which maps, as the only map I can think of that have colourization only differentiation of same units ownerships is Feudal Japan (and its variants).
I actually believe it is lame having the same units for different players, aside from units that don't need to be set apart (factories...), and all units should be actually different beyond colourization, but, of course, someone would need to work on achieving that, and I can see it would be very challenging providing different images for destroyers, cruisers and battleships, one for each player in assets, while keeping them well distinct.
p.s.: I overlooked the off topic about having a sea zones colour. I agree to that, and I already said so in the past; it's not important, but tiles should not be required for basic display, and indeed they are not required in all cases but for sea zones (as now, otherwise, all the sea will be black like the zones' borders). The two items to add here would be the ability to assign a colour for sea zones and the ability to set any such items has having no colours (fully transparent) (I suggest doing it but having the entry and leaving it empty), the sea zones having no colour if not defined. A third item may be being able to define a colour for unassigned zones (which means mostly the borders), pure black if not defined (this one should be the only item that you cannot set transparent).
-
@Cernel Yes, Feudal Japan is a good example where units are truly monocolor and the same minus colorization across all players so would be a good candidate for this.
-
@redrum Was that thing of making the new political notifications different from targets and others ever implemented in Feudal Japan? If not, is it available at the engine level? I'm thinking Feudal Japan may have a number of tweaks on hold, and we could push them all at the same time on a new version. I would also much benefit from upping the starting castles in each capital to 3, for gameplay purposes (I always edit that, when I play the game).
-
@Cernel Do you mean this change: https://github.com/triplea-game/triplea/issues/3558
I'm focusing first on just implementing the change in the engine and will document it in POS2. But we can discuss updating Feudal Japan if you want but probably better to create a separate thread if you do.
-
@redrum Yeah. Has that been added to Feudal Japan. If not, is that currently supported by the program (so we can add it to Feudal Japan).
-
@Cernel It is supported in TripleA and I added an example to POS2: https://github.com/triplea-maps/the_pact_of_steel/pull/20/files. I don't believe Feudal Japan was ever updated to use it.
-
Just to mention, two more really great uses for this:
- help people that are colorblind. If the unit colors look similar, an option to adjust per-country hue so they can be visible would be excellent. Flags would help this, I'm sure using colors that look physically different would be even better.
- building on maps that have many nations. If for example someone wanted to mod a map that has many nations, like NWO, or anything with 10 nations+, adding a new unit is a bit of a nightmare. You have to use color-picker very well to match the existing hue and it's hard to say if the new units will still look cohesive. For example, add cavalry and heavy cavalry, that is perhaps 20 units images and for each you need to do a really great match of existing hue for it not to look just hacked on.
@Cernel I suspect the usage of this feature would be opt-in per map, or could be used as a fallback when unit images are missing. It wouldn't be the case that we'd go through all existing maps an delete units images to leave just the auto-colorized ones.
-
In the moment a unit that is in a units subfolder (a folder inside "units" having a player's name) can be used only by 1 player, I really feel it is making little sense to colorize it in any ways, as the unit can be, or rather should, be just already made as it is supposed to look. So, on the "fallback" matter, I think it would be better to apply any of this recolourization only on the units directly inside the units folder (shared by all players not having them in their subfolders), but possibly with the ability to define in map.properties units that must not be recolourized, but never on units inside any units subfolders.
-
@Cernel The issue with that is it limits players being able to change unit colors (see color blind example above). So I think its better to colorize all of a nations units unless they are in the exemption list. This makes the feature more useful to existing maps.
You can also imagine modding an existing map where you want to create say a new Axis and a new Allies player. Each side has unique images so you want to copy say all germany's units to the new Axis player then colorize them and copy all UK's units to new Allies player and colorize. This would make it so you want the units in the nations folder not in the units folder directly.
-
@redrum Ok, well, if by that you mean that there would be a user option to change units colours while you play, that would give some reasons about recolourizing an already coloured unit used by only one player. I was not considering that, as I assumed that was just a proposal. However, I would not advise giving players the ability to recolourize units colours, at least at the present state. Almost no one plays Feudal Japan, and even if you are playing something like Revised, that is not really good, as it would be unpolished to monocolourize multicolour images, like aa radars and damaged battleships (I know, these are rather small details, but still unpolished).
-
@redrum said in Dyeing/Colorizing Unit Images:
You can also imagine modding an existing map where you want to create say a new Axis and a new Allies player. Each side has unique images so you want to copy say all germany's units to the new Axis player then colorize them and copy all UK's units to new Allies player and colorize. This would make it so you want the units in the nations folder not in the units folder directly.
It is really not hard to learn to colourize images with a program like GIMP. Also you can find addons for GIMP that allow you to easily recolourize a whole batch of units in a folder. So, in this case, what the mapmaker needs to do is just pasting the folder it wants, then running a batch recolourization of all, or some, of the images inside it.
-
@Cernel For now, it would probably be just like nation territory ownership colors where users can edit the map.properties to override the defaults but it could potentially be added as an in-game option eventually. While it might look a bit unpolished for people the are color blind or maps with many nations, being able to see the units is probably more important then them being perfect.
Given the history of map makers and many of the existing maps we have, people must find it harder than you think to colorize images as we have lots of maps with units that don't match well or appear to be hacked up. Even look at Dom 1914 NML, where I took a recent pass to clean some of it up but before that it was kind of a disaster and that's a relatively popular map. Some of this feature is to help novice map makers, but its also to give players flexibility to override unit color defaults in map.properties.
-
@redrum I dunno. It just feels not sensible to me that you have a bunch of colourized units that are used only by one player and you also have a (mapmaker/powerusers only) setting that recolourize those already colourized units for that one same player, while you could open a graphic program and imput those same settings there, to get the units right. I don't know if maybe it would be feasible and sensible adding a mapmaking utility for recolourizing units, with the ability to select them specifically or a whole folder (I would still use GIMP). That could stay beside the utility for making the smallMap, I guess.
-
@redrum I'm not really suggesting this, as it might be too much, but it would be also possible to have an alliance subfolder in units. So, for example, the program would look for the unit in "Germans", if not there it will look for the unit in "Axis", if not there it will look for the unit in the units folder, if not there will repeat the above while looking at the program's assets. This would work in a definitive way for the game currently, as there is no way to trigger changes to the alliances during the game (something that it may be good to have).
-
@Cernel I considered that as well but didn't think it was worth adding this go around (maybe a phase 2). If lots of people start putting units directly in the units folder to share and there is a lot of interest in having alliance folders to share units just across an alliance then we should be able to add it in later on.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login