29

I'm editing a Readme.md file in a Github repository and have inserted a picture (see https://github.com/khpeek/FMCW-radar). The picture takes up the full width but is rather grainy that way, and I would prefer to make it smaller. Is there any way to do that?

P.S. I've tried the commands on How to change image size Markdown?, but they don't seem to work.

Community
  • 1
  • 1
Kurt Peek
  • 52,165
  • 91
  • 301
  • 526

3 Answers3

60

You can change the size of an image in GitHub markdown by using the image link in an HTML img tag:

From this:

![image](https://user-images.githubusercontent.com/link-to-your-image.png)

To this:

<img src="https://user-images.githubusercontent.com/link-to-your-image.png" width="200" />
Jon Wood
  • 1,531
  • 14
  • 24
  • This isn't working for me because they put a max-width="100%" style tag in there. Even if I try to override the style it doesn't work. – John Ernest Jan 24 '21 at 05:03
  • 2
    @JohnErnest - the `max-width` style shouldn't be a problem unless you're trying to do a width greater than `100%`. Maybe you're putting `width` in a style tag which wouldn't work - you need to put `width` as an attribute like in the `To this:` line – Jon Wood Jan 25 '21 at 10:15
  • I wanted the text to be exactly 1260px because that's what the screenshot was, but I had to workaround it by making the screenshot wider to match the screen resolution so that even when scaled up it doesn't make the text too big to see. – John Ernest Jan 25 '21 at 18:52
8

For images with links, I used this.

[<img src="./assets/sql.svg" width="30" />](./link/to/sql/file)
Kapchi
  • 106
  • 1
  • 4
6

You must downsize the image in an image editor. You can't change image size on GitHub's flavor of markdown.

Also: The image is already very grainy, it's not a result of its size changing.

Andy Ray
  • 30,372
  • 14
  • 101
  • 138