Mail Archives: djgpp/1999/02/12/09:38:01
Dave Nugent writes:
> I want to be able to take a 24 bit color bitmap, and create
> 3 seperate files from it, 1 for Red, Green and Blue.
Read in your source in 24 bit format (set_color_depth(24),
set_color_conversion(COLORCONV_TOTAL), then load it in as usual).
Use getpixel() to read pixels from the source graphic, getr24(),
getg24() and getb24() to split that value up into individual
color components, create_bitmap_ex() to construct three eight bit
output images, putpixel() to write your r/g/b values to these
images, and save_bitmap() to save out the results.
Shawn Hargreaves.
- Raw text -