Acknowledged

bitmaps occupies too much memory

I have a code

	Communications.makeImageRequest(
			strUrl,
			{},
			{
				:palette => [ Graphics.COLOR_BLACK, Graphics.COLOR_WHITE],
				:maxWidth => w,
				:maxHeight => h,
				:dithering => Communications.IMAGE_DITHERING_NONE
			},
			self.method(:onReceiveImage)

and after response I've checked in memory monitor size of bmp

- sizie in pxel 127x127 (about 16000 pixel)

- size of png - about 400b

- size of bitmap about 4000b

so it means ciq bmp

- no any compression

- and even the size is twice then required because

-- 2 colors in palette so one byte can save info about 8 pixels

-- 16000/8 = 2000 instead of 4000!!

  • There are several issues at play here.

    First off, we do transfer images to the device in a compressed format where it makes sense. This significantly reduces the time it takes to transfer an image over slow transfer medium like bluetooth. We decompress the image into formats supported by the native renderer, and neither our software or hardware render paths support compressed source image data.

    While this could be considered an issue that could possibly be addressed on the software render implementation, I believe that this is a hardware limitation on GPU devices.

    In debugging this, I'm seeing that despite requesting only two colors for the palette, the resulting image comes across with three. The additional entry is for transparent. The result of this is each pixel requires 2b to store instead of the expected 1b, effectively doubling the amount of memory required for an image. It is not yet clear to me why we reserve transparent, but I'm fairly certain we can do something on the image service to leave out the transparent palette entry if the result image does not utilize it.

    As for the additional bloat seen on GPU devices, this is due to hardware requiring that each row of pixel data be aligned to a 64B boundary. With an image that is 127px wide and 2bpp, each row is 32B. When we pad each row out to 64B, this effectively doubles the amount of memory required. You can easily verify this by loading an image that is 255x127px. It will take the same amount of memory as the one that was 127x127, despite being more than 2x the size.

  • the same bitmap in graphics pool takes ~8000 (f7)