minetest / minetestmapper

Generates a overview image of a minetest map.
BSD 2-Clause "Simplified" License
112 stars 40 forks source link

Missing handling for colorized textures (Grass isn't green) #90

Open randomMesh opened 2 years ago

randomMesh commented 2 years ago

Generating a colors.txt file for MineClone2 with the dumpnodes mod yields in a brownish color (RGB 142 131 114) for mcl_core:dirt_with_grass.

See attached image, "singleplayer" literally is standing in a meadow but it looks like there's only rock.

I expect the color to be more greenish. For example, the color for default:dirt_with_grass in the shipped colors.txt is RGB 64 111 26, which is way better.

I think the problem lies within the average_color function in util/generate_colorstxt.py https://github.com/minetest/minetestmapper/blob/9b26d9495cdaaf6af13ff7b5bde0560198e3c722/util/generate_colorstxt.py#L63

map

randomMesh commented 2 years ago

In comparison, here is the same map if i replace the color for mcl_core:dirt_with_grass with the one from the shipped colors.txt. Looks like that more colors are off.

map

sfan5 commented 2 years ago

The color generation process picks the first filename from the texture string, MCL probably has a gray texture and uses [colorize to get different shades. The script could detect this and attempt to handle it but this is just bandaid (it won't handle complex texture strings). Seeing as Minetest Game also has some manual color adjustments I think the best fix is if MCL shipped a colors.txt for their game.