Mustafa E. Korkmaz 0 Posted July 21, 2023 (edited) I use Delphi 11.3 8 bit images are displayed very badly on windows 11 computer. I think the color palette is different. image1 and image2 show same 24 bit bmp on screen. When you click to '8bit' button it changes pixel format of image2. procedure TForm1.b8bitClick(Sender: TObject); begin image2.Picture.Bitmap.PixelFormat := pf8bit; end; I run the same program on windows 10 and windows 11 computers. The image2 in windows 11 looks very bad. The first of the attached pictures is from windows 10, the second is from windows 11 (22H2). When I open the same 24-bit image in the paint brush application in windows 11 and save it as 256 colors, it still looks very bad on the screen. So I guess it's not about delphi directly. But maybe it's possible to restore the old color palette from delphi. The application I developed uses 8bit images heavily. How can I solve this problem? Edited July 21, 2023 by Mustafa E. Korkmaz Share this post Link to post
Lars Fosdal 1792 Posted July 27, 2023 (edited) @Mustafa E. Korkmaz Does this setting have any effect? https://support.microsoft.com/en-us/windows/auto-color-management-in-windows-11-64a4de7f-9c93-43ec-bdf1-3b12ffa0870b Edit: What is the color resolution of the system that Windows 11 runs on? Is there a way to optimize the image palette to match the default 256 color Windows palette? Edited July 27, 2023 by Lars Fosdal Added two questions Share this post Link to post
Mustafa E. Korkmaz 0 Posted July 28, 2023 No. did not change the result >Is there a way to optimize the image palette to match the default 256 color Windows palette? I have no idea yet how to do it. Share this post Link to post
eivindbakkestuen 47 Posted August 3, 2023 On 7/21/2023 at 9:51 PM, Mustafa E. Korkmaz said: The application I developed uses 8bit images heavily. Why, out of curiosity? Share this post Link to post
chmichael 12 Posted August 26, 2023 Did you find any solution ? I have the same problem! Share this post Link to post
Anders Melander 1784 Posted August 26, 2023 On 7/27/2023 at 6:50 PM, Lars Fosdal said: the default 256 color Windows palette There is no default 256 color palette. Old version of Windows "reserved" 16 fixed colors while new versions reserve 20 fixed colors. https://en.wikipedia.org/wiki/List_of_software_palettes#Microsoft_Windows_default_20-color_palette Changing the pixelformat to pf8bit forces the bitmap to use a color palette. I.e. instead of each pixel explicitly specifying the RGB color values, the pixels will contain an index into a palette of 256 colors. The colors in a palette generated by Windows will partially depend on the system palette which again depends on the Windows theme. https://learn.microsoft.com/en-us/windows/win32/gdi/system-palette-and-static-colors https://learn.microsoft.com/en-us/windows/win32/gdi/default-palette If you want a predictable result then you need to generate the palette using a predictable method: Either use a static palette or generate one using color quantization. There are methods in the GifImg unit for both solutions. https://docwiki.embarcadero.com/Libraries/Sydney/en/Vcl.Imaging.GIFImg.ReduceColors 1 Share this post Link to post
chmichael 12 Posted September 4, 2023 Yeap, ReduceColors doesn't have this issue! Share this post Link to post