6
$\begingroup$

Turns out, based on the responses, that the topic is much more complex than I first envisioned. One alternative is for someone to edit the corresponding Help article (referenced below), with a link to this article.

Then, the user can read the full details about the issue of image sizing. In the meantime, whenever I reference the corresponding Help article, I will also reference this article.


The Images section, at the bottom of this article, documents how to embed images into a mathSE question or answer. I recommend enhancing that section of the article to include something like the insertion in this posting, that follows the Edit section:


Edit
Thanks to Ray Butterworth's answer for an idea that I totally overlooked. I have edited the suggested insert (below) accordingly.

Actually, I don't know what to make of his response. I am assuming that if no width parameter is provided, then the default will be whatever the pixel-width of the uploaded image happens to be. My guess (which could be wrong) is that if you are using a middle-of-the-road display resolution (whatever that means), then it would generally be best to adjust the width until it looks suitable to you.

Edit
Re the article referenced in Calvin Khor's comment, in my opinion, specifying absolute pixel size seems to give the most flexibility. Therefore, the only concept that I took from the article for insertion into the suggest edit (below) concerns optionally changing the aspect ratio.


Start of Suggested Insert

You also have the option to control the size of the displayed image via the following syntax:

<img src="https://i.stack.imgur.com/m2uYu.png" width="200">

When formatting your posting, you can experimentally change the width parameter above to find the image size that you regard as the most suitable for your posting.

You can also specify the height only (instead of the width). Further, if you don't mind changing the aspect ratio change, you can specify both the width and the height:

<img src="https://i.stack.imgur.com/m2uYu.png" width="300" height="500">

Be aware that, in general, using absolute sizes can produce something that looks good on your screen, but awful on other people's. For example, to someone with a 4k monitor, a 200 pixel image will look tiny, since it is only 5% of the width of the screen. However, to someone using a low resolution monitor, the image may be seen as huge, depending on just how low resolution the monitor is.

End of Suggested Insert


My motive in making this recommendation is that when I post a comment that refers a user to the corresponding help article, I will no longer need to supplement my comment with the additional instructions that pertain to controlling the size of the image.

$\endgroup$
4
  • 1
    $\begingroup$ There are examples and an alternative way (using a syntax not of HTML or Markdown, but of Imgur) here (iirc the imgur implemented method gives you a subpar picture) $\endgroup$ Jul 22, 2021 at 2:41
  • $\begingroup$ @CalvinKhor +1 : Interesting. See my edited posting. $\endgroup$ Jul 22, 2021 at 3:58
  • $\begingroup$ Well, there is a balance between flexibility and ease of use, particularly if you want "the masses" to use it. When you use the GUI to upload images, it generates Markdown for you. Imagine that you do not know HTML but want to use a smaller image; it is then much simpler to edit the already generated Markdown by adding s or m to the URL $\endgroup$ Jul 22, 2021 at 4:21
  • $\begingroup$ @CalvinKhor Good point. If a moderator adopts my recommendation and edits the Help article, then they will have a decision to make, about how much technical detail to include. From what you have commented, I think there is merit on both sides of the issue of whether to include the options of adding (for example) s or m to the URL. $\endgroup$ Jul 22, 2021 at 8:18

1 Answer 1

6
$\begingroup$

experimentally change the width parameter to find the image size that you regard as the most suitable

Be aware that, in general, using absolute sizes can produce something that looks good on your screen, but awful on other people's.

I'm looking at this on a 4K monitor, so 200px is going to look too tiny (that's only 5% of the width of my screen), while someone using a low resolution monitor will see it as too huge.

$\endgroup$
5
  • 1
    $\begingroup$ +1 : totally overlooked that, I will edit my answer accordingly, since I think that your insight belongs in the Help article. $\endgroup$ Jul 22, 2021 at 0:58
  • $\begingroup$ Is there a way to resize an image with html on MSE that avoids this issue? $\endgroup$ Jul 22, 2021 at 14:25
  • 1
    $\begingroup$ @MikeEarnest With HTML itself no. Presentation, such as size, is no longer a part of HTML. That the <img> tag still has a width attribute is a holdover from when it took a long time to download the image. All formatting should be done using <style>, but I don't know much at all about what user-supplied HTML or style is supported by Stack Exchange. ¶ In general, images should have style something like either height="auto" width="33%" min-width="15em" (for visual images), or height="5em" width="auto" max-width="100%" (for images with text or other fine details), with no absolute units. $\endgroup$ Jul 22, 2021 at 17:56
  • $\begingroup$ @MikeEarnest FYI, instead of trying to adjust the image size in HTML, note there are various different sizes available for each uploaded image in imgur. For details, see How do I set the size of a picture in my question post?, Resizing an image in a post?, Preserve image transparency when resizing images and Chat truncates regular imgur links when they end in 's', 'm', 'l', 'h', …. $\endgroup$ Jul 23, 2021 at 0:57
  • 2
    $\begingroup$ @JohnOmielan I don't think that's a good solution since resizing the image this way reduces the resolution substationally, and just looks bad. $\endgroup$ Jul 23, 2021 at 3:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .