top | item 29610763

(no title)

rp1 | 4 years ago

Bitmaps take memory, but are quite efficient from a runtime perspective because they aren’t encoded.

discuss

order

giantrobot|4 years ago

> Bitmaps take memory, but are quite efficient from a runtime perspective because they aren’t encoded.

Memory and bandwidth. To decode/display an image it's got to be loaded from storage. In the case of a Retina display iPad that's 2048x1536px. With a 24-bit color depth that's a 9MB bitmap to load from disk (SSD or whatever).

I just did a test with ImageMagick. The same 2048x1536 image encoded to an uncompressed Windows bitmap is 9MB while the same image as a PNG (PNG24, zlib level 9, with adaptive scanline filtering) is only 4MB. That's less than half the data to load off disk.

Unless CPU power is at an absolute premium you're probably better off with an image with lossless compression rather than completely uncompressed.

seoaeu|4 years ago

> Unless CPU power is at an absolute premium you're probably better off with an image with lossless compression rather than completely uncompressed.

Really depends on the exact situation. If your image decompression algorithm runs at 100 MB/s, but your disk bandwidth is 250 MB/s and you have plenty of space...

rp1|4 years ago

True, bandwidth is a concern. It might be possible to copy memory directly from disk to the GPU, which may be more efficient.

Retric|4 years ago

Bitmaps take both bandwidth and space, either can be an issue.