pixel_for_bmap returns pixel in specific format (depends on color mode). To retrieve pixels red, green, blue, and alpha, use pixel_to_vec(color,alpha,format,pixel). You may look in the manual for these functions. Examples are included there.
Unfortunately, I've not worked with 3dGS for a while now, but it was fun