Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32bpp recolouring via. mask algorithm #5316

Closed
DorpsGek opened this issue Oct 3, 2012 · 1 comment
Closed

32bpp recolouring via. mask algorithm #5316

DorpsGek opened this issue Oct 3, 2012 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Oct 3, 2012

Zephyris opened the ticket and wrote:

The current recolouring algorithm for company colours, bridge recolours, etc. in 32bpp is extremely bright. This leads to several problems. For a "sensible" 32bpp render (using all grey values from 0 to 255) recolouring is essentially always too bright.

For a test grf which demonstrates this problem see 32bppCCDemo.grf. To see the result of the recolouring open the company information window. The bus showing the company colour is replaced with a 32bpp image with grey values from 0 (left) to 255 (right) recoloured with the 8 company colour shades from darkest (top) to lightest (bottom).

  1. Even using the darkest company colour in the 8bpp recolour masks company colours are easily oversaturated. When using the darkest company colour for reshading light company colours (like white, orange, yellow) saturate uncontrollably. Recolouring_Brightness1.png
  2. It is impossible to achieve sensible recolourings for some company colours (brown, purple) when forced to use the darkest shades of company colour in the 8bpp recolour mask. Brown goes to orange and purple to pink. Recolouring_Brightness2.png

These issues have been discussed on the forum:
http://www.tt-forums.net/viewtopic.php?p=1040469# p1040469

The current recolouring algorithm is:
pixel = colour_from_palette * max(R,G,B) / 64

I suggest it is changed to:
pixel = colour_from_palette * max(R,G,B) / 128

This would allow the use of lighter shades of company colour in recolour masks (solving problem 2) and solve oversaturation problems (problem 1). Solving this issue quickly is important before too many 32bpp graphics are available which depend on the recolouring algorithm.

These examples focus on company colours, but bridge recolours and similar also have the same problems.

Attachments

Reported version: Version?
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5316
@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Implemented

in r24610


This comment was imported from FlySpray: https://bugs.openttd.org/task/5316

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant