<p>Don't store the rasterized image instead store the drawn strokes as vector graphics. Those should compress pretty well.</p>

<p>Adding timestamps to each stroke should then be very simple.</p>

<p>You can caching the rasterized image during execution to avoid needing to rerender every stroke every frame.</p>

CC BY-SA 4.0
2018-10-12T10:12:56.377Z
What happens when someone wants to erase, and how do I approximate strokes if the user can draw whatever shape the want?
huB1erTi2
CC BY-SA 4.0
2018-10-12T10:57:11.057Z
Erasing is drawing with the background color. You can use a series of splines to approximate each stroke.
ratchet freak
CC BY-SA 4.0
2018-10-12T10:04:49.380Z
2018-10-12T10:04:49.380Z
ratchet freak
<p>I need to store user-drawn images from an online whiteboard. The amount of data gets huge quickly which is obviously not good. What I need is to store something drawn through a tablet for example in as little space as possible without too much of accuracy loss as for example letters should be distiniguishable. Bonus points for a solution with the ability to determine when what was drawn.</p>

<compression>
Compression of user-drawn "whiteboard" image
huB1erTi2
# Compression of user-drawn "whiteboard" image

(Asked by: username_0 on 2018-10-11)

I need to store user-drawn images from an online whiteboard. The amount of data gets huge quickly which is obviously not good. What I need is to store something drawn through a tablet for example in as little space as possible without too much of accuracy loss as for example letters should be distiniguishable. Bonus points for a solution with the ability to determine when what was drawn.

**Tags:** compression


---

## 1 answers

### Answer by username_1 on 2018-10-12. Score: 2 | Accepted answer

Don't store the rasterized image instead store the drawn strokes as vector graphics. Those should compress pretty well.

Adding timestamps to each stroke should then be very simple.

You can caching the rasterized image during execution to avoid needing to rerender every stroke every frame.

> **Comments:**
> **username_0**: What happens when someone wants to erase, and how do I approximate strokes if the user can draw whatever shape the want?  
> **username_1**: Erasing is drawing with the background color. You can use a series of splines to approximate each stroke.  

---

