Is it okey if we use base64 strings inside notebooks?

As I understand Observable can’t host it’s own the images.

But there is a way around this, by using base64 strings as an image’s src attributes.

Is it okay if we do that? (Cell sizes will be way bigger than in usual cases)

Cells have a length limit of 65,636 characters - besides that, anything that fits is fair game inside of a cell. Whether I’d recommend it, though - until we have file hosting, your best bet is still using an external host like imgur or Flickr. They won’t have the same sort of size restriction, and will likely be a lot easier to work with in notebooks and faster for pageloads.

For really small images, totally - a bunch of notebooks already use data-uris for this sort of trick, and it works great. But larger images are likely going to bump up against that cell length limit or slow down the page, and would be better suited as files hotlinked from an image host.

1 Like

To be explicit: we do not recommend Base64-encoding large amounts of data (or files or images) and embedding them in cells. Yes, it is possible for certain sizes—and fine for tiny things like single-pixel PNGs—but Base64-encoding is inefficient and it’ll be slow at larger sizes. Until we offer our own file hosting, you’re best off hosting your files elsewhere, such as on GitHub, imgur, etc.

1 Like