image-processingmfccbitmap

Improving the grey scale conversion result


Here is the colour menu:

Menu with colour bitmaps

Here is the same menu with some of the menu items disabled, and the bitmaps set as greyscale:

Menu with greyscale bitmaps

The code that converts to grey scale:

auto col = GetRValue(pixel) * 0.299 + 
           GetGValue(pixel) * 0.587 + 
           GetBValue(pixel) * 0.114;
pixel = RGB(col, col, col);

I am colourblind but it seems that some of them don’t look that much different. I assume it relates to the original colours in the first place?

It would just be nice if it was more obvious they are disabled. Like, it is very clear with the text.

Can we?


Solution

  • For people who are not colour blind it's pretty obvious.

    Just apply the same intensity reduction to the images that you do to the text.

    I did not check your values. Let's assume the text is white (100% intensity).

    And the grayed out text is 50% intensity.

    Then the maximum intensity of the bitmap should be 50% as well.

    for each gray pixel:
      pixel_value = pixel_value / max_pixel_value * gray_text_value
    

    This way you decrease further decrease the contrast of each bitmap and avoid having any pixel brighter than the text.