lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread Michael von Aichberger
Hi List, I know how to calculate the amount of memory an image takes: img.width * img.height * img.depth / 8 If I import a 24-bit image, the resulting cast member is 32 bit. Or if I create an image in 24 bit color depth: img = image(width, height, 24) img.depth always gives 32. Maybe it's

Re: lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread Daniel Nelson
Hi Michael, I would guess that this has to do with how each pixel is represented. On a 32-bit architecture, each integer can be divided into pixels a number of ways neatly: four 8-bit pixels, two 16-bit pixels, one 32-bit pixel. To span a pixel across integers would be inefficient. So for

Re: lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread alpha
On a different, but related note, try using 1-bit members versus 32-bit. 1-bit will animate slower than 32-bit, even though it is 32 times as small. Really? I've been using 1-bit bitmaps for my text highlighter, with the belief that I can resize and reposition them more quickly and reliably

Re: lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread Daniel Nelson
Hi Kerry, It's definitely an issue. In one project, I have a white and black bitmap covering the entire stage (and it's a large stage, matching the monitor up to 1400X1050). It is dynamically rendered to connect different elements of a visual data structure. At 1-bit, it was totally

Re: lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread Tab Julius
The problem with one-bit stuff is getting that bit out of there. You have to break apart a byte to get at each bit and it's a hassle with code. It keeps the image size down, sure, but it's not fast. You'd be much better off going with 256-color images. Still enough color to do most artwork,

AW: lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread Michael von Aichberger
32-bit would be fastest from the point of view of accessing (quickest to access a 32-bit offset) but it's a pig when it comes to space. Thanks Tab and all who answered. The 1-bit, 8-bit or 16-bit solutions don't interest me, because my images are and have to be 24-bit. Can anybody please

Re: lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread alpha
It's definitely an issue. At 1-bit, it was totally unnacceptable, even on a fast machine. At 8-bits, it plays fine. For my text highlighter, I use QuickDraw rectangles. Thanks. I've used vectors for text highlighting, too. This was an inherited project, and the outgoing engineer insisted

Re: AW: lingo-l memory usage of bitmap 24/32-bit images/ bitmap cast members

2003-09-12 Thread alpha
Can anybody please confirm that 24-bit images always take up the same memory space as 32-bit images? One word: alpha. There really is no such thing as 32-bit color, at least in common useage. A 32- bit image has 24 bits for color, and 8 bits for the alpha channel. I think Director keeps that