Resize the image in jupyter notebook using markdown
Solution 1
If you're attaching your images by inserting them into the markdown like this:

These attachment
links don't work:
<img src="attachment:Screenshot.png" width="500"/>
DO THIS. This does work. Just add div brackets:
<div>
<img src="attachment:Screenshot.png" width="500"/>
</div>
Hope this helps!
PS I'm using jupyter_core-4.4.0
& jupyter notebook.
Solution 2
You can use html directly
<img src="image.JPG" alt="Drawing" style="width: 200px;"/>
Solution 3
Image control in Jupyter markdown is possible but the image needs to be preceded by "attachment" or it doesn't display.
<img src="attachment:image.png" width="400">
With a url it works directly:
<img src=https://image.slidesharecdn.com/tensorflowppt-160408142819/95/tensorflow-4-638.jpg?cb=1460125744 width="500">
Solution 4
You need to use HTML as Mark showed you, since you cannot do it with 
syntax. From John Gruber's website:
As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML tags.
Solution 5
You can also use Image
module from IPython.display
https://ipython.org/ipython-doc/3/api/generated/IPython.display.html#IPython.display.Image
for example
from IPython.display import Image
Image(url='https://www.maxpierini.it/ncov/pics/ITA.png', width=200)
Use filename=
instead of url=
if the image is a local file.
Related videos on Youtube

Anil Verma
I am passionate about data and what it brings to the world. It helps taking better decisions and helps in retaining shortfall. And thats exactly what I do. I am passionate about data, working with it, manipulating it. I like to work on data, wither I download them from INTERNET or create one keeping a problem in mind. Then try to make the scenario and try to solve it. I have knowledge about bigdata hadoop, spark and Azure ML. I love working with r but now I am learning python also to be more effective with deep learning.
Updated on January 17, 2022Comments
-
Anil Verma 11 months
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

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  but then the image does not appear.
Does anybody know of a way to add an image with pre-specified dimensions?
-
Waylan almost 6 yearsPossible duplicate of How to change image size Markdown?
-
rAntonioH about 5 yearsIn the future if you use ![alt] you will see "alt" appear and you know it is working, but that something in your link did not work.
-
-
Quantum7 almost 5 yearsI think this is the correct approach. Unfortunately block attributes (
{: width=200}
) are not supported by jupyter's markdown renderer. -
webelo over 4 yearsIn Jupyter Lab I had success resizing with
width=200
but not thestyle="width: 200px;"
. -
memeplex over 3 yearsThe problem is that attachments are no longer recognized and exported to html, reveal, etc. when this syntax is used.
-
ijoseph about 3 yearsNote that at least for me, I first have to paste by keystroke into a Markdown cell to create the

syntax, then replace that with the above. Otherwise, it can't seem to find the attachment source image (attachment:image.png
). -
Arthur almost 3 yearsCurrently this works in colab, while the body of the answer doesnt. <img src="image.slidesharecdn.com/tensorflowppt-160408142819/95/…" width="500px"/>
-
ego2509 over 2 yearsThis should be the right answer, it works also with google colab using an url in the src tag
-
Raunak Thomas about 2 yearsStrange, it doesn't work for me, its simply giving blank. For some reason I guess its not loading the attachment. (I'm using the latest version of Jupyter notebook and python btw
-
edesz about 2 yearsGreat answer! Is is possible to set the height and width at the same time?
-
Admin 11 monthsAs it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
-
Quetzalcoatl 10 months@edesz: yes: for example, use
style="width: 400px; height: 300px;"
in Mark's answer above -
SteveWithamDuplicate 8 monthsWhat I've found in Jupyter is that width DOES work but height DOES NOT.
-
Cam Cairns 8 monthsyou can also use a percentage value for image width <img src="2D_affine_transformation_matrix.svg" width="90%"/>