Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
214 Beiträge
 
#3

AW: weniger Scanline aufrufe ... Graustufenbild

  Alt 11. Feb 2024, 09:35
Found a resource might be helpful at last.

https://stackoverflow.com/questions/...-grayscale-bmp

From the first answer, though the question and the code is to make a gray scale 8bit bitmap from colored
Code:
            var entry = bmp.Palette.Entries[index];
            var gray = (int)(0.30 * entry.R + 0.59 * entry.G + 0.11 * entry.B);
            newPalette.Entries[index] = Color.FromArgb(gray, gray, gray);
This line is adjusting the palette (i was looking for this word!!) i used lookup table or predefined color table.
  Mit Zitat antworten Zitat