# Downloadable Cells

**URL:** <https://talk.observablehq.com/t/downloadable-cells/1849>\
**Category:** Feedback\
**Created:** [April 4, 2019, 7:21pm UTC](https://talk.observablehq.com/t/downloadable-cells/1849 "2019-04-04T19:21:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jashkenas](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jashkenas/32/1778_2.png) [@jashkenas](https://talk.observablehq.com/u/jashkenas)\
**Post date:** [April 4, 2019, 7:21pm UTC](https://talk.observablehq.com/t/downloadable-cells/1849/1 "2019-04-04T19:21:27Z")

</div>

Hello all,

We’ve just pushed out an update that makes cells conveniently downloadable from the cell menu — in the style of Mike’s useful [Saving SVG](https://observablehq.com/@mbostock/saving-svg) notebook.

Here’s a quick example:

[https://user-images.githubusercontent.com/4732/55582171-a94d1480-56d3-11e9-9df7-288878fbeb16.gif(image larger than 4 MB)](https://user-images.githubusercontent.com/4732/55582171-a94d1480-56d3-11e9-9df7-288878fbeb16.gif)

- Data cells should be downloadable as CSV (if CSV-shaped), and in all cases as JSON.
- SVG cells should be downloadable as SVG or PNG.
- Canvas cells should be downloadable as PNG.

Please let us know if it works well for your notebooks: if there are any cells that you think you ought to be able to download that you can’t, or conversely that you shouldn’t be able to download but you can. … or if you have any bright ideas for other download types that we should offer.

Cheers!  
Jeremy

---

<div class="post-metadata">

**Author:** ![Evan](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/evan/32/276_2.png) [@Evan](https://talk.observablehq.com/u/Evan)\
**Post date:** [April 4, 2019, 7:41pm UTC](https://talk.observablehq.com/t/downloadable-cells/1849/2 "2019-04-04T19:41:44Z")

</div>

This is great - thanks! I was importing the download functions into pretty much every notebook.

---

<div class="post-metadata">

**Author:** ![jrus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jrus/32/586_2.png) [@jrus](https://talk.observablehq.com/u/jrus)\
**Post date:** [April 4, 2019, 11:26pm UTC](https://talk.observablehq.com/t/downloadable-cells/1849/3 "2019-04-04T23:26:34Z")

</div>

Can you add some metadata indicating sRGB to the PNG files?

(Are browsers doing any kind of reasonable color management these days, and properly treating unlabeled stuff as sRGB, the way the spec demands? I spent years occasionally harassing them about how they weren’t following their own spec, but at some point gave up and stopped paying attention.)

---

<div class="post-metadata">

**Author:** ![jashkenas](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jashkenas/32/1778_2.png) [@jashkenas](https://talk.observablehq.com/u/jashkenas)\
**Post date:** [April 4, 2019, 11:58pm UTC](https://talk.observablehq.com/t/downloadable-cells/1849/4 "2019-04-04T23:58:02Z")

</div>

Although the current state of affairs in canvas-colorspace land is indeed dismal: [https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md](https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md)

It appears as though Chrome and Safari both do the right thing, and include the sRGB colorspace metadata in the PNG.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/1/15c8b397e513fb26ea790a00cfd2cd029550ab42.jpeg)

It’s only Firefox that fails to include it.

---

<div class="post-metadata">

**Author:** ![jrus](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jrus/32/586_2.png) [@jrus](https://talk.observablehq.com/u/jrus)\
**Post date:** [April 5, 2019, 12:26am UTC](https://talk.observablehq.com/t/downloadable-cells/1849/5 "2019-04-05T00:26:27Z")

</div>

Ah gotcha. I didn’t look at how this was implemented. Saving out PNGs is a native browser feature? I thought you might be constructing a PNG file yourself in code, in which case indicating sRGB is fairly simple as there’s an [explicit flag for it](http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.sRGB) in the format.

---

<div class="post-metadata">

**Author:** ![jashkenas](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/jashkenas/32/1778_2.png) [@jashkenas](https://talk.observablehq.com/u/jashkenas)\
**Post date:** [April 23, 2019, 7:53pm UTC](https://talk.observablehq.com/t/downloadable-cells/1849/6 "2019-04-23T19:53:39Z")

</div>

Mini update on downloadable cells:

- When you download an SVG as a PNG, we now do a better job inlining images and CSS styles, so that what you see in your notebook is what you get as an image file.
- `<style>` cells are now downloadable as CSS files:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/observablehq/original/2X/e/e8a4fc4b7ba5213fb7f99a07ba474dbd38609e30.png)
