dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]bmp's


From: Oscar Papel
Subject: Re: [DotGNU]bmp's
Date: Mon, 27 Oct 2003 13:46:16 -0500

If you send me an image, I'll convert it for you.
I also have written this type of code in the past. 
I treated each pixel as a uint16 and combined them as follows:
 
// note: this code assumes little-endian CPU
byte red,green,blue,alpha;
 
// RGB24 to RGB15 (x-5-5-5)
uint16 pixel=(((uint16)blue<<10) & 0x7C00) |
    (((uint16)green<<5) & 0x03E0) |
    (((uint16)red) & 0x001F);
 
// RGBA32 to RGBA16 (1-5-5-5)
uint16 pixel=(((uint16)alpha<<15) & 0x8000) |
    (((uint16)blue<<10) & 0x7C00) |
    (((uint16)green<<5) & 0x03E0) |
    (((uint16)red) & 0x001F);
 
// RGB24 to RGB16 (5-6-5)
uint16 pixel=(((uint16)blue<<11) & 0xF800) |
    (((uint16)green<<5) & 0x07E0) |
    (((uint16)red) & 0x001F) ;
 
----- Original Message -----
From: Neil Cawse
Sent: Monday, October 27, 2003 10:46 AM
Subject: [DotGNU]bmp's

Im working on finishing off bmp support in DotGNU.Images.

Im having a problem finding a program that can convert a 24 bit bitmap(bmp) to 16 bit.

The 16 bit format is uncommon for writing and comes in two varieties – 5-5-5 and 5-6-5.

Is there anyone who could convert and image for me for testing or give me an image in these two formats?

 

Thanks

Neil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]