Wikipedia:Autosizing images

The following are techniques to auto-size, or scale, any image ("thumb" or "frameless"), based on each user's default thumbnail size (220px for those not logged in or for those who have not changed it at Special:Preferences). Within an image link, the options are as follows:

  • thumb – displays the image as a framed thumbnail at the user's default size
  • frameless – displays the image as an unframed at the user's default size
  • upright – scales the image to approximately 75% of the user's default size (25% smaller)
  • upright=0.8 – scales the image to approximately 80% of the user's default size (20% smaller)
  • upright=1.2 – scales the image to approximately 120% of the user's default size (20% larger)
  • left – shifts the image to the left margin
  • right – shifts the image to the right margin
  • center – shifts the image to center between left/right margins

Each of the above sizing options can be used in any image link coded into a Wikipedia page, in the form [[File:Example.jpg|thumb|upright|left|Description]]. When a user views the page, the image will be resized based on the user's default image size setting.

Effects of upright

The available values for thumbnail size in Preferences (on the Appearance tab) are 120px, 150px, 180px, 200px, 220px (default), 250px, 300px, and 400px. As explained at Wikipedia:Extended image syntax § Size, upright=Factor will "adjust a thumbnail's size to Factor times the default thumbnail size, rounding the result to the nearest multiple of 10". That can be calculated on Wikipedia via {{#expr: SIZE * FACTOR round -1}}, which is how the following table was generated.

Effects of upright on image widths available in user preferences
120px150px180px200px220px
(default)
250px300px400px
upright=0.340px50px50px60px70px80px90px120px
upright=0.670px90px110px120px130px150px180px240px
upright=0.75
upright
90px110px140px150px170px190px230px300px
upright=0.8100px120px140px160px180px200px240px320px
upright=0.85100px130px150px170px190px210px260px340px
upright=0.9110px140px160px180px200px230px270px360px
upright=0.95110px140px170px190px210px240px290px380px
upright=1120px150px180px200px220px250px300px400px
upright=1.05130px160px190px210px230px260px320px420px
upright=1.1130px170px200px220px240px280px330px440px
upright=1.15140px170px210px230px250px290px350px460px
upright=1.2140px180px220px240px260px300px360px480px
upright=1.25150px190px230px250px280px310px380px500px
upright=1.3160px200px230px260px290px330px390px520px
upright=1.35160px200px240px270px300px340px410px540px
upright=1.5180px230px270px300px330px380px450px600px
upright=1.8220px270px320px360px400px450px540px720px

Examples

thumb, frameless, upright

The following examples use the "thumb" or "frameless" options to set an image to the default size, with "upright" to scale the image larger or smaller than the default size. When using these options, a small image will never be scaled larger than its original size.

Options usedLarge imageSmall image
|thumb
|thumb|upright=1.35
|thumb|upright=0.3
|frameless
|frameless|upright=1.35
|frameless|upright=0.3

In the examples above, the size of the image is scaled based on each user's default image size, which can be changed at Special:Preferences. Setting image size in pixels, such as "250px", would override the user's preference and display the image as 250px wide for all users who view that image on that page.

left, right, center

As shown in the prior examples, "thumb" defaults to right aligned, while "frameless" defaults to left aligned. This can be changed by using "left", "right", or "center". The following examples include lorem ipsum text before (in red) and after (in green) to show how it wraps around the image.

Alignmentthumbframeless
leftLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
rightLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
centerLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Purpose of autosizing

Because many users have begun viewing Wikipedia articles on various smaller devices, not just desktop PC computers, the autosizing of images will allow each user to view those images as smaller pictures on handheld devices, such as laptops, notebook or tablet computers, and some mobile phones. The users can set their Special:Preferences to select their default image size (such as: 250px, 180px, or 120px), for whichever handheld device they use for viewing Wikipedia pages.Autosizing of images will also allow sight-impaired users, per WP:Access, to enlarge their default image-size (such as 300px) to perhaps see details more clearly.

See also

[ This essay is a quick draft to be expanded later. ]