htmlimagejupyter-notebookmarkdownjupyter

Resize the image in jupyter notebook using markdown


I want to add the image in the Jupyter notebook and I want to have particular height and width. When I try to add the image using

![](img.png)

the code is adding the complete image but as per the image dimension and I don't have control over it. I try to use ![](img.png =200x100) but then the image does not appear.

Does anybody know of a way to add an image with pre-specified dimensions?


Solution

  • If you're attaching your images by inserting them into the markdown like this:

    ![Screenshot.png](attachment:Screenshot.png)
    

    Do this instead:

    <div>
    <img src="attachment:Screenshot.png" width="500"/>
    </div>
    

    Unfortunately, it doesn't work without the surrounding divs:

    // this does not work
    <img src="attachment:Screenshot.png" width="500"/>
    

    PS I'm using jupyter_core-4.4.0 & jupyter notebook.