# Generation of images when using nbconvert as library to generate markdown

**URL:** <https://discourse.jupyter.org/t/generation-of-images-when-using-nbconvert-as-library-to-generate-markdown/13123>\
**Category:** nbconvert\
**Created:** [February 22, 2022, 1:02pm UTC](https://discourse.jupyter.org/t/generation-of-images-when-using-nbconvert-as-library-to-generate-markdown/13123 "2022-02-22T13:02:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptcane](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/ptcane/32/5793_2.png) [@ptcane](https://discourse.jupyter.org/u/ptcane)\
**Post date:** [February 22, 2022, 1:02pm UTC](https://discourse.jupyter.org/t/generation-of-images-when-using-nbconvert-as-library-to-generate-markdown/13123/1 "2022-02-22T13:02:55Z")

</div>

When using nbconvert from the command line, I use `--to markdown` and it automatically creates a folder of any cell output as .png images.

How can i get this same behaviour when using as a library (`MarkdownExporter`)?

I see that there is a list of images in resources[‘output’] but am not sure how I can write these to a .png file and get them working (encoding?). However I’m hoping worrying about this is unnecessary, if I can find an equivalent to the command line behaviour.

---

<div class="post-metadata">

**Author:** ![balaram\_kunam](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/balaram_kunam/32/6697_2.png) [@balaram\_kunam](https://discourse.jupyter.org/u/balaram_kunam)\
**Post date:** [March 12, 2022, 4:44pm UTC](https://discourse.jupyter.org/t/generation-of-images-when-using-nbconvert-as-library-to-generate-markdown/13123/2 "2022-03-12T16:44:37Z")

</div>

I am also stuck at this.

Please someone help.
