How to convert a bitmap with quality of 32 bits to 16 bits in C #

We have two images, the first image is recorded in WindowsXP for 32-bit image quality and the same is recorded in WindowsXP for 16-bit color quality. Both images were saved as a bitmap. But when comparing both, we observe that the hash values ​​are different. Here we plan to implement C # code to convert a 32-bit image with color quality into a 16-bit image with color quality.

Has anyone worked on such a problem of comparing raster images, any inputs on this front would be appreciated.

Thank you very much in advance.

+3
source share
1 answer

Try using the following

var bmp = new Bitmap(yourImage.Width, yourImage.Height, System.Drawing.Imaging.PixelFormat.Format16bppRgb555);
using (var gr = Graphics.FromImage(bmp))
    gr.DrawImage(yourImage, new Rectangle(0, 0, yourImage.Width, yourImage.Height));

bmp - 16-

+1

Source: https://habr.com/ru/post/1796088/


All Articles