6 ms·
Bitmaps take memory, but are quite efficient from a runtime perspective because they aren’t encoded.
by rp1 5y ago
Bitmaps take memory, but are quite efficient from a runtime perspective because they aren’t encoded.
- Retric 5y agoBitmaps take both bandwidth and space, either can be an issue.
- giantrobot 5y 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 5y 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 5y agoTrue, bandwidth is a concern. It might be possible to copy memory directly from disk to the GPU, which may be more efficient.
- giantrobot 5y agoAssuming the on-disk version of a graphic is compatible with your particular GPU. Even within the same manufacturer two generations of GPUs might not use the same image format. A generalized on-disk representation is safer and likely more forwards compatible.