@Jyrki Lahtonen has specified one way to do so which is most widely used. I would like to add a more information :
- When using an
<img>
tag, any attributes must be specified in the following order else it will strip the tag and the image will not be displayed: src
, width
, height
, alt
, title
. The values for the width
and height
attributes can be up to 999.
Add a character to the file name to specify a size
If the images are hosted on the Stack Exchange imgur.com account (which most are), you can add single character suffix to the filename in the URL after the image id and before the extension to get resized versions.There are 6 total thumbnails that an image can be resized to. The thumbnails are here.
For example, you can use
https://i.sstatic.net/a9LCgl.jpg
instead of
https://i.sstatic.net/a9LCg.jpg
to get a more manageable size screenshot.
But I've personally observed that decreasing the size of image by this method decreases the resolution of the image,too. So, if needed, you can always link to the full-size screenshot too; transform:
[![enter image description here][1]][1]
[1]: https://i.sstatic.net/a9LCg.jpg
to
[![enter image description here][1]][2]
[1]: https://i.sstatic.net/a9LCgl.jpg
[2]: https://i.sstatic.net/a9LCg.jpg
and it'll link the reduced-size version to the full-size (original) image.
The square options will scale the image (up as well as down) and crop to fit the size, thumbnails are only ever scaled down (smaller images are not scaled up) to fit with the square maximum dimensions.
NOTE: Resizing only the preserves the first frame of an animated GIF image. If you need to resize an animation, use HTML markup instead (i.e. use <img>
).
WARNING: Imgur seems to have consistency issues with generating the different sizes of images, where not all suffixes give you a resized image; and are instead served the original image. I don't know what causes this to happen or what a work-around might be.
Add a ?s=X
query string to the URL for some square sizes
You can add a query string to the URL to specify some specific sizes. The available sizes are dimensions that are the powers of two from 16 up to 512 (i.e. X can be 16, 32, 64, 128, 256 and 512).
Using this method will produce a square image. The image may be cropped and/or resized without preserving the image's aspect ratio.
Example (with link to full sized image):
[![enter image description here][1]][2]
[1]: https://i.sstatic.net/a9LCg.jpg?s=256
[2]: https://i.sstatic.net/a9LCg.jpg
There were discussions on the same topic on Meta SE and Meta SO.