paletted 8bpp images are incorrect
I am seeing two issues; the first is the palette not being the right one, the second is related to the colours.
In the ImageJ script you remove entries from the palette, but later you use that reduced set of colours as palette for the PNG. This makes NML bail out because it is an unknown palette. The attached patch solves it for me. It also solves an issue I got with file separators. For me it generated files with a \ in their name instead of putting them in the right directory.
Regarding the colours, as you can see in the screenshot the colours get somewhat messed up for drive through road stops, which are the ones I added the 8bpp mask to. I think you should only use colours where you want some colour change to happen, e.g. in the screenshot you can see a part of the roofs getting the red which seems to be the right behaviour. For the other cases it tries to do some colour conversion, but I don't think you want that there. I fear this requires more experimentation, but I do not really understand your script nor have I ever used blender. I have attached a patch for zbasebuild that allows you to test the mask files yourself with these drive through road stops.
#2 Updated by Rubidium over 7 years ago
The recolouring algorithm works by taking the colour from the 8bpp image and using the intensity (saturation?) of the 32bpp image. So for a (company colour) recolour you just need a single colour for the bits that you want to be recoloured. In the images I showed in the previous 'post' you can see I used the same colour in the 8bpp image, but there are different shades of the (recoloured) colour in OpenTTD
#3 Updated by zephyris over 7 years ago
Would these mask sprites be ok? The three different colours are index 198 (dark blue, company colour) and 70 (dark brown, bridge recolour) and 0 (transparent blue).
If I understand correctly then only pixels in the 32bpp sprite which correspond to pixels with a company colour index (i.e. 198) in the 8bpp mask sprite get recoloured for a sprite which has company colour recolouring. Is that right?
#4 Updated by Rubidium over 7 years ago
- File Kraletava Transport, 2040-02-23.png added
It is going to recolour using the bridge recolour regardless whether it's a bridge or not. It simply uses the colour of the 8bpp sprite, which for the bridge recolour only changes when it is a bridge. So in this case I would definitely not add the bridge recolour colour to the 8bpp mask sprite.