Looking for help with BitBlit and BMP files...

Tim Olson tim at jumpnet.com
Mon Dec 4 22:54:02 UTC 2000


>My problem is if leftEyeImage and rightEyeImage was saved as a BMP file 
>from Photoshop4 then I get "blank holes (white)" in my final anaglyphImage 
>where pure black should be.
>
>If leftEyeImage and rightEyeImage was saved as a jpg file then everything 
>seems as expected (black is black).
>
>Do you think this would be from:
>
>1) my BitBlit code below
>2) Squeaks BMP vrs JPEG reading code
>3) Photoshop4

Probably 2):

>From the comment in 

Color >> PixelValueForDepth:

	"Details: For depths of 8 or less, the result is a colorMap index. For 
depths of 16 and 32, it is a direct color value with 5 or 8 bits per 
color component."
	"Transparency: The pixel value zero is reserved for transparent. For 
depths greater than 8, black maps to the darkest possible blue."

So Squeak reserves the pixel bit pattern of all zeros for transparent.  
Any code in Squeak that directly generates bitmaps from external sources 
should take this into account and substitute the bit pattern ..0001 for 
any pure black color.  The code in the JPEG reader handles this during 
color conversion and clipping, but perhaps the BMP reader (I don't seem 
to have this in my image) doesn't do this.



     -- tim






More information about the Squeak-dev mailing list