# How do buffers work?

**URL:** <https://forum.makecode.com/t/how-do-buffers-work/44161>\
**Category:** Arcade\
**Tags:** game, demo\
**Created:** [May 25, 2026, 9:39pm UTC](https://forum.makecode.com/t/how-do-buffers-work/44161 "2026-05-25T21:39:41Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 29, 2026, 5:07pm UTC](https://forum.makecode.com/t/how-do-buffers-work/44161/21 "2026-05-29T17:07:13Z")

</div>

Looks like about this small: EBAzMzMzMzMzMzMzMzMzMzMzM2MzM2NmMzMzZjMzNjMzMzNjM2MzMzMzM2MzYzMzMzMzYzNjYzYzMzNjM2M2YzMzM2MzYzMzNjMzYzNjMzM2MzNjMzM2YzMzM2MzM2M2MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMw==  
Yeahh… there could be more compression you could do if you had a limited color palette, for example limiting it to 8 colors would half the length of this code, but it would still be really long. 16 x 16 is 256, so that’s 256 pixels you need to store. What I did in my code made it so that each character in the base64 string represents 1.5 pixels (I think) which is pretty good but that still means a lot of data is needed to store 256 pixels! You could always make the image black and white if you really wanted the code to be only a few characters, and I can certainly write the code for you to do that if need be! :)

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [May 29, 2026, 5:10pm UTC](https://forum.makecode.com/t/how-do-buffers-work/44161/22 "2026-05-29T17:10:44Z")

</div>

actually limiting to 8 colors would be 3 bpp instead of 4 bpp, so it would reduce the size by 25% rather than 50%

if you wanted half the memory for an image, you would want 2 bpp, which would be 4 colors!

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [May 29, 2026, 5:44pm UTC](https://forum.makecode.com/t/how-do-buffers-work/44161/23 "2026-05-29T17:44:49Z")

</div>

Oops! Yeah that makes sense now that I think about it.

[Previous page](https://forum.makecode.com/t/how-do-buffers-work/44161.md?page=1)
