Skip to content

Instantly share code, notes, and snippets.

@uupaa
Last active December 23, 2024 19:52
Show Gist options
  • Save uupaa/f77d2bcf4dc7a294d109 to your computer and use it in GitHub Desktop.
Save uupaa/f77d2bcf4dc7a294d109 to your computer and use it in GitHub Desktop.
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png =250x250)

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png)

    • Copy <img> in browser DevTools. Replace ![](url) to <img>. Add width(and height) attr.
    • <img src="https://camo.githubusercontent.com/..." data-canonical-src="https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png" width="200" height="400" />

Other information

@mjbear
Copy link

mjbear commented Nov 17, 2024

I clicked on one of the icons first. Example below:

@crissyg
Thank you for the response.
Awesome.
There is certainly a small preview for SVG images as you've demonstrated.

I can't seem to get that to work for PNG or JPG though.
https://github.com/github/docs/blob/main/contributing/images/repository-fork-button.png
https://github.com/github/docs/blob/main/contributing/images/fastly_purge.jpg

@crissyg
Copy link

crissyg commented Nov 19, 2024

@mjbear You're welcome and yes you're right about .jgp and .png files. Those are showing the actual sizes and not automatically resizing like the .svg files. I've been using svg for icons mostly . But you could convert jpg to svg using https://www.freeconvert.com/jpg-to-svg and then try it that way or resize each jpg/png using html like in the previous posts. <img src="image_location/image_name.png" width="10%"/> and change the width percentage to your liking. Example <img src="https://github.com/github/docs/blob/main/contributing/images/fastly_purge.jpg" width="10%"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment