Help:Images

From BoyWiki
Adding images to your page

Only curators can upload and make available a new image/picture. Available images can be reviewed by category.

BoyWiki users may submit new images via email or by adding a request to the requests for image uploads page, and externally hosted images may not be linked inline with article text. Any image that is contributed must conform to the base guidelines and be submitted to be licensed under the GNU Free Documentation License by the copyright holder.

Basics

Basic wikicode

The basic wikicode is:

  • [[Image:filename.jpg]]

This would show the raw file

  • [[Image:filename.jpg|left|thumb|upright=1.5|''Comment on the image'']]

In this case, it is a thumbnail centered left. 1.5 determines a proportion of the original file.

Links


To link to some other page, specify its name in the link option along with an appropriate caption that hints to readers what will happen if they click on the link. This caption serves both as title text for the tooltip, and as alt text for visually disabled readers. For example, " [[File:CARAGLIO Giovanni Jacopo 1530c Apollo e Giacinto 802x1042.jpg|100px|right|link=Hyacinth (mythology)]]" generates an image that links to the article about Hyacinth.



Advanced

[[File:Name|Type|Border|Location|Alignment|Size|link=Link|alt=Alt|Caption]]

Plain type means you always type exactly what you see. Bolded italics means a variable.

Only Name is required. Most images should use "[[File:Name|thumb|alt=Alt|Caption]]" and should not specify a size. The other details are optional and can be placed in any order.


Type
"thumb" (or "thumbnail"; either can be followed by "=filename"), "frame" (or "framed"), or "frameless". Displays the image with specific formatting (see below).
Border
"border". Put a small border around the image.
Location
"right", "left", "center" or "none". Determine the horizontal placement of the image on the page. This defaults to "right" for thumbnails and framed images.
Alignment
"baseline", "middle", "sub", "super", "text-top", "text-bottom", "top", or "bottom". Vertically align the image with respect to adjacent text. This defaults to "middle".
Size
"Widthpx" or "xHeightpx" or "WidthxHeightpx" or "upright" or "upright=Factor". Scale the image to be no greater than the given width or height, keeping its aspect ratio. With "upright", scale a thumbnail from its default size by the given factor (default 0.75), rounding the result to the nearest multiple of 10 pixels. Scaling up (i.e. stretching the image to a greater size) is disabled when the image is framed.
Link
Link the image to a different resource, or to nothing. Must not be set for non-public domain images unless attribution is provided in some other fashion.
Alt
Specify the alt text for the image.
Caption
Specify the image's caption. This is visible only if "frame" or "thumb" attribute is used.

Detailed syntax

The image syntax begins with "[[", contains components separated by "|", and ends with "]]". The "[[" and the first "|" (or, if there is no "|", the terminating "]]") must be on the same line; other spaces and line breaks are ignored if they are next to "|" characters or just inside the brackets. Spaces or line breaks are not allowed just before the "=" in the following options, and may have undesirable side effects if they appear just after the "=".

Type

Zero or one of these options may be specified to control whether or not the image is scaled down and given a border.

thumb
(Or thumbnail.) Scale the image down, and put a box around the image. Show any caption below the image. Float the image on the right unless overridden with the location attribute. If no image size is specified, use a per-user preference for logged-in users (see "Thumbnail size" under {under your user preferences appearance files ), defaulting to 220 pixels for non-logged-in users. May be used in conjunction with the "upright" option. With an operand, e.g., "thumb=Example.png", the operand names an image that is used as the thumbnail, ignoring any size specification.
frame
Preserve the original image size, and put a box around the image. Show any caption below the image. Float the image on the right unless overridden with the location attribute. Displayed size of an image will not be scaled when "frame" is used.
(nothing specified)
Preserve the original image size, and do not add a border around the image. Do not show a caption. If no alt text is specifically requested, use the requested caption as alt text.
frameless
Scale the image down. Place the image inline with the text unless overridden with the location attribute. If no image size is specified, use a per-user preference for logged-in users (see "Thumbnail size" (under your user preferences appearance files ), defaulting to 300 pixels for non-logged-in users. May be used in conjunction with the "upright" option.

Border

border
Generate a one-pixel border around the image. This has an effect only around unframed images ('none' and 'frameless'), as framed images always have borders.

Location

Zero or one of these options may be specified to control the position of the image.

right
Place the image on the right side of the page. The article text that follows the image flows around the image. This is the default when thumb or frame is used.
left
Place the image on the left side of the page. The article text that follows the image flows around the image.
center
Place the image in the center of the page. The article text that follows the image is placed below the image.
none
Place the image on the left side of the page. The article text that follows the image is placed below the image.

If none of these four options is used, and neither thumb nor frame is present, the image is placed inline with the text, smile like this.

Vertical alignment

Zero or one of these options may be specified to control the vertical alignment of the image with respect to adjacent text. These options apply only to plain images, which do not cause breaks and are not floated (that is, they do not work with images that have text wrap to flow around them). To make text flow around an image, place the image preceding the text. In the following list, each option's explanation is preceded by what File:Flag of Albania.png looks like when aligned with that option, using the markup:

[[File:Flag of Albania.png|option|8px|link=|alt=]]
baseline
Align the bottom of the image with the baseline of the text.
middle
(This is the default.) Align the vertical middle of the image with the baseline of the text plus half the x-height of the text, so that the image is vertically centered around a lower case "x" in the text.
sub
Align the bottom of the image to the same level that the bottom of a subscript would be, such as the bottom of the "2" in "X2".
super
Align the bottom of the image to the same level that the bottom of a superscript would be, such as the bottom of the "2" in "X2".
text-top
Align the top of the image to the top of the text. This is often a bit higher than the top of a capital letter, because of ascenders in letters like lower-case "h".
text-bottom
Align the bottom of the image to the bottom of the text. This is somewhat lower than the baseline, because of descenders in letters like lower-case "y".
top
Align the top of the image to the top of the line containing the text. Normally this is slightly higher than the top of the text, to make space between lines of text.
bottom
Align the bottom of the image to the bottom of the line containing the text. Normally this is slightly lower than the bottom of the text.

Size

Any or none of these options may be specified to control the size of the image. In the case of images with captions, if the image is already smaller than the requested size, then the image retains its original size (it is not enlarged). In the case of images without captions, the image will be enlarged or reduced to match the requested size. Sizing is disabled when a 'frame' is used.

Widthpx
(E.g., "100px".) Scale the image to make it the specified number of pixels in width, and scale the height to retain the original aspect ratio.
xHeightpx
(E.g., "x150px".) Scale the image to make it the specified number of pixels in height, and scale the width to retain the original aspect ratio.
WidthxHeightpx
(E.g., "100x150px".) Scale the image to be no wider and no higher than the specified number of pixels. The image will keep its original aspect ratio.
(nothing specified)
For thumbnails, use the size specified in preferences for logged in users, and use a size determined by resolution for anonymous users. For non-thumbnails, use the native size of the image.
upright
Scale a thumbnail image to 75% of normal thumbnail width, rounding the result to the nearest multiple of 10 pixels.
upright=Factor
Adjust a thumbnail's size to Factor times the default thumbnail size, rounding the result to the nearest multiple of 10. For instance, "upright=1.5" makes the image larger, which is useful for maps or schematics that need to be larger to be readable. The parameter "upright=1" returns the same size as thumbnail width, and "upright=0.75" is functionally identical to "upright" alone. If you set Factor equal to the image's aspect ratio (width divided by height) the result is equivalent to scaling the height to be equal to the normal thumbnail width.

The "upright" option must be used along with the "thumb" or "frameless" parameter.

Link

Ordinarily, an image acts as a hypertext link to the image description page, a page with information about the image itself. Using the link option allows an image to act as a hypertext link to a different page.

link=Page
The image acts as a hypertext link to the specified page. Do not enclose the page name in square brackets. If Page is a URL, the image acts as an external link; otherwise it links to the named Wikipedia page.
link=
No hyperlink is created. Clicking on the image will have no action.

The "link" parameter cannot be used in conjunction with "thumb", as "thumb" is always meant to link to the larger version of the image. In addition, "link" cannot be used with "frame".

File:File:ANKER Albert 1897 Schlafender Knabe im Heu 2660x2075.jpg rendered as a thumbnail above; Media:ANKER Albert 1897 Schlafender Knabe im Heu 2660x2075.jpg is the direct link

One may wish to link directly to the image file without displaying any thumbnail or preview image at all, possibly useful for downloading or viewing directly with a compatible browser. The ANKER Albert 1897 Schlafender Knabe im Heu 2660x2075.jpg‎ at the right contains [[Media:ANKER Albert 1897 Schlafender Knabe im Heu 2660x2075.jpg‎]] as such a virtual Media link in its caption.

Alt text and caption

Zero or more of these options may be specified to control the alt text, link title, and caption for the image. Captions may contain embedded wiki markup, such as links or formatting.

alt=Alt
Use Alt as the alt text for the image.
Caption
(any text that is not recognised as some other part of the image syntax): How this text is used depends on the image type. When the type has a visible caption ("thumbnail", "thumb", "frame" or "framed") then this text appears as a caption below the image. Otherwise, (if the image type is unspecified or is "frameless"), this text is used for the link title provided the link has not been suppressed with "|link=", and also for the alt text provided an explicit alt=Alt has not been supplied.

The actual alt text for the displayed image will be one of the following, in order of preference:

  1. The explicitly requested Alt, if any;
  2. The explicitly requested Caption, if the image type has no visible caption;
  3. The empty string, if there is an explicitly requested Caption and the image type has a visible caption.
  4. The image file name if there is no explicitly requested Alt or Caption. This is never a satisfactory option.

It is only possible to specify the link title text for images with no visible caption (as described above). However, as not all browsers display this text, and it is ignored by screen readers, there is little point.

How to display an image in uploaded size, with a caption

To display an image as uploaded with a caption use [[File:Hyacinth.jpg|frame|none|alt=Alt text|Caption text]].

Alt text
Caption text

How to display an image with no caption or formatting

The old syntax for images without captions is [[File:Westminstpalace.jpg|Alt text]]. This is rendered inline, and the specified text is used as the image's alt attribute (alternate text for programs which cannot display images, such as screen readers) and as the title attribute (supplementary text, often displayed as a tooltip when the mouse is over the image).

See Wikipedia:Image markup with HTML for an old, deprecated, way of putting a caption under the image using HTML code. Please use the new way of associating captions with images, as described on this page.

See Wikipedia:Captions for discussion of appropriate caption text. See Wikipedia:Alternative text for images for discussion of appropriate alt text.

Example

Alt text

New syntax for images

A large clock tower and other buildings line a great river.
Face-smile.png

The new syntax is backward compatible, so articles don't have to be changed.

In the syntax [[File:filename|options]] (e.g., [[File:Face-smile.png|thumb|100px|left|alt=A large clock tower and other buildings line a great river.|The Palace of Westminster]] shown in the left), several options can be set when including an image. Those affect the placing of the image, its size or the way the image will be presented. The options are right, left, center, none, sizepx, thumbnail (thumb), frame, and alternate (caption) text.
A large clock tower and other buildings line a great river.
face smiling
  • The options can be combined, and vertical bars ("|") are used to separate options from each other.
  • Do not put spaces around the vertical bars for readability – options will not be interpreted correctly.
  • The options can be put in any order.
  • An unknown option is taken as the caption text, but this will appear only if thumbnail or frame are specified.
  • If there are two or more unknown options, the last one upstages the rest: [[Face-smile.png|thumb|alt=Face-smile.png.|Face-smile.png|200px|right|Face-smile.png]] (shown on the right).

Here is the description of the options other than the caption text:

right

A large clock tower and other buildings line a great river.
The image is right-aligned, and text floats to the left of the image: [[File:Face-smile.png|right|70px|alt=Face-smile.png.]] (shown on the right).

left

A large clock tower and other buildings line a great river.
The image is left aligned, and text floats to the right of the image: [[File:Face-smile.png|left|70px|alt=A large clock tower and other buildings line a great river.]] (shown on the left).

center

The image is centered, and...
A large clock tower and other buildings line a great river.
the text following the image starts below it: [[File:Face-smile.png|center|70px|alt=A large clock tower and other buildings line a great river.]] (shown above).

none

The image is put at the left, and...
A large clock tower and other buildings line a great river.
the text following does not float to the right (or to the left, obviously), and starts below it: [[File:Face-smile.png|none|70px|alt=A large clock tower and other buildings line a great river.]] (shown above).

Notes:
A large clock tower and other buildings line a great river.
The four options below (center, left, none, and right) are incompatible. When used combined, the first one overrides the rest: [[File:Face-smile.png|center|left|none|right|70px|alt=A large clock tower and other buildings line a great river.]] (shown in the center).
A large clock tower and other buildings line a great river.
What is between the last vertical bar and the closing brackets ("]]"), void or not, is taken as the last option, and works as usual. For instance, when the last option is right, the image is right-aligned, and text floats to the left: [[File:Face-smile.png|70px|alt=A large clock tower and other buildings line a great river.|right]] (shown on the right).
A large clock tower and other buildings line a great river.
A large clock tower and other buildings line a great river.
This text is displayed.
In particular, if the last option is the void text (that is, if there is nothing between the last vertical bar and the closing brackets), the caption is not displayed: [[File:Westminstpalace.jpg|thumb|alt=A large clock tower and other buildings line a great river.|This text is not displayed.|70px|left|]] (shown on the left) and [[File:Face-smile.png|thumb|alt=A large clock tower and other buildings line a great river.|This text is displayed.|70px|right]] (shown on the right).
File:Westminstpalace.jpg
There is in HTML/CSS a floating issue that prevents certain images (or other multimedia objects) from floating above others. It occurs only if:
  • there are multiple multimedia objects on one side of the page
  • the multimedia object on the other side of the page comes after the other ones in the source code
The first multimedia object on the latter side of the page won't float above the last multimedia object on the former (see images on left and right). To get around it, you have to alternate between left and right in aligning images or other multimedia objects (see below) or, when that's not possible, set to "none" the alignment of the one that won't float above the others (see the population table here for an example).


File:Westminstpalace.jpg
sizepx
A large clock tower and other buildings line a great river.
This option renders a version of the image that's [size] pixels wide (e.g., [[File:Face-smile.png|right|50px|alt=A large clock tower and other buildings line a great river.]] shown on the right). Height is computed to keep the ratio (i.e. the shape of the image).
Notes:
Specifying a size does not just change the apparent image size using HTML; it actually generates a resized version of the image on the fly and links to it appropriately. This happens whether or not you specify the size in conjunction with "thumb".
This means the server does all the work of changing the image size, not the web browser of the user. By having the server do all the work means faster downloading of pages. It also means that larger images can be stored on the server without any slowdown by the browser (especially on dial up telephone lines). Only the data for the actual size on the page is transmitted.
An exception is animated GIF images. Animated GIF images are not processed by the server. When a smaller size is specified the original full sized animated GIF image is served. Whether the animated GIF image is subsequently scaled to fit the allotted space belongs to the capabilities of the receiving browser. Resizing an animated GIF image will significantly reduce its quality, without any reduction of download time.
From MediaWiki 1.5 the default thumbnail width can be set in the preferences, so it is recommended not to specify "px", in order to respect the users' preferences (unless, for a special reason, a specific size is required regardless of preferences, or a size is specified outside the range of widths 120–300 pixels that can be set in the preferences).
If you specify a "frame" option the image will not be scaled, and no size specifiers will be in the HTML. The image will be rendered at full size.
A large clock tower and other buildings line a great river.
When there are two or more "size" options, only the last one is valid: [[File:Face-smile.png|right|50px|80px|alt=File:Face-smile.pngr.]] (shown on the right).
thumbnail, thumb
A large clock tower and other buildings line a great river.
A large clock tower and other buildings line a great river.
File:Face-smile.png
The thumbnail (thumb) option generates an image. It is automatically resized when the "size" attribute is not specified. Without the options left, center, and none, the image is normally on the right. If the image has a caption text, it is displayed in the lower margin. E.g., [[File:Face-smile.png|thumbnail|left|100px|alt=File:Face-smile.png]] (shown on the left) and [[File:Face-smile.png|thumb|alt=File:Face-smile.png|File:Face-smile.png]] (shown on the right). Note: thumbnail (thumb) cannot be used in lists.
Tiny globe
This is a globe, and take a look at it in the actual size.
An "enlarge" icon is put also in the lower margin of the thumbnail. Both the image itself and the icon link to the image description page with the image in its actual size. The icon shows the link title "Enlarge" in its hoverbox, even in cases where this term does not apply, because it leads from the enlarged image to the one with the actual size. E.g., [[File:tst.png|right|thumb|100px|alt=Tiny globe|This is a globe, and take a look at it in [[Media:tst.png|the actual size]].]] (shown on the right).
upright
File:Face-smile.png
The "upright" option is about 75% of thumbnail width.
File:Face-smile.png
The "upright=1.5" option
The upright option works in combination with the thumbnail or thumb option to resize an image to about 75% of the width of a plain thumbnail. The upright option scales larger or smaller in step with user screen resolution. The relative size can be determined with a multiplier such as upright=x. If x=1 then the image is standard thumbnail width. E.g., [[File:Face-smile.pngg|thumbnail|upright|left|alt=A large clock tower and other buildings line a great river.|The "<code>upright</code>" option is about 75% of thumbnail width.]] (shown on the left) and [[File:Face-smile.png|thumb|upright=1.5|right|alt=A large clock tower and other buildings line a great river.|The "<code>upright=1.5</code>" option]] (shown on the right).
frame
A large clock tower and other buildings line a great river.
The Palace of Westminster
With this option, the embedded image is shown with its actual size enclosed by a frame, regardless of the "thumb" or "size" attribute, and the caption, if any, is visible in the frame. Without the options left, center, and none, the image is normally on the right: [[File:Face-smile.png|frame|thumbnail|50px|alt=A large clock tower and other buildings line a great river.|The Palace of Westminster]].

With none of the options other than sizepx and alternate (caption) text, an embedded image is rendered inline.

text text text text text text
[[File:Face-smile.png|150px|alt=A large clock tower and other buildings line a great river.|The Palace of Westminster]]
text text text text text
[[File:tst.png|100px|alt=Tiny globe|This is a globe.]]
text text text text

gives

text text text text text text A large clock tower and other buildings line a great river. text text text text text Tiny globe text text text text

The option none can be used to have thumbnails without left- or right-alignment. This is probably most useful for tables. This is an example:

How to use none
London's palaces
Palace of Westminster
A large clock tower and other buildings line a great river.
From the Thames
[[File:Westminstpalace.jpg|thumb|none|100px|alt=A large clock tower and other buildings line a great river.|From the Thames]]
Buckingham Palace
Grand city building below beautiful blue sky and clouds
Queen's home
[[File:Buckingham palace Copyright2003KaihsuTai.jpg|thumb|none|100px|alt=Grand city building below beautiful blue sky and clouds|Queen's home]]

Thumbnail with caption text underneath that has one or more links

From MediaWiki 1.3, it is also possible to include links in the caption text, e.g.:

[[File:Westminstpalace.jpg|right|thumbnail|alt=A large clock tower and other buildings line a great river.|This is the [[Palace of Westminster]] in London]]
A large clock tower and other buildings line a great river.
This is the Palace of Westminster in London


Just make sure the number of opening and closing square brackets are right. One extra or missing would mean the entire image syntax line would not work.

Additional caption formatting options

Additional caption formatting options are possible.

[[File:Westminstpalace.jpg|right|thumbnail|alt=A large clock tower and other buildings line a great river.|<div align="center">This is <span style="color: green">the </span><br /> [[Palace of Westminster]]<br /> '''in <span style="color: red">London</span>'''</div>]]
A large clock tower and other buildings line a great river.
This is the
Palace of Westminster
in London


All of the normal text formatting options work.

Overlaying annotations on an image

In some cases, it may be desirable to add clickable annotations to an image. The templates Template:Annotated image and Template:Annotated image 4 exist for this purpose.

These templates allow wikitext (e.g., regular text, wikilinks, allowed html code, references, and other templates) to be included on the image itself. They may also be used to crop an image so as to focus on a particular portion of it, or alternatively, expand the white area around an image for better placement of wikitext.

Annotated image template examples
Template:Annotated image Template:Annotated image 4
File:Wiwaxia body zones.png
The image and caption as a thumb, sans annotations

Compatibility considerations

The floating options left, center, and right explained above are supported by modern browsers, but don't work with older browsers. If necessary it's simple to get a floating effect also for old browsers:

A large clock tower and other buildings line a great river.
{| align="right"
| [[File:Westminstpalace.jpg|160px|alt=A large clock tower and other buildings line a great river.|Example]]
|}

This code is not intended for general use, however. There are few, if any, instances where support for such legacy browsers is necessary.

Cancelling floating-around-image mode

After having had an image floating next to text, putting further text below it and again using the full width can be done with the following markup. This blocks an image from appearing next to the material following this markup, possibly due to aesthetic reasons or a change in topics.

<br style="clear:both" />

For legacy align="right" (etc.) floating this isn't good enough; legacy browsers would ignore inline CSS. To cancel floating under all conditions the following markup (valid XHTML 1.0 transitional) works:

<br clear="all" />

The same code can be issued by using template {{clear}} or {{Clr}} or {{-}} in certain namespaces (en, meta).

Linking to the image without displaying it

If you don't want to show or display the image but rather just want to make a link to the description page for an image, use a leading colon before "File:" in an intra-wiki link, like this: [[:File:STS-32 crew.jpg|STS-32 crew]] which yields: STS-32 crew.

Images that link somewhere other than the image description page

See also: Wikipedia:Images linking to articles

It is possible to make an image that links to a different page instead of to the image description page. This should be done conscious of the image's licensing terms and can be achieved by using the "|link=" option. To disable the link altogether and have a purely decorative image, in the sense that the image is not shown to visually impaired readers, use "|link=|alt=", with no arguments for either parameter.

Multimedia syntax

The extended syntax, in addition to yet more syntax, can also be applied to sound and video files. In these examples, File:, the namespace equivalent to Image:, is used. Either namespace can be used.


More syntax for videos

Hopefully videos will be coming soon to BoyWiki.
Initial still image
"thumbtime=Time". Use the frame from the video at the given time as the initial still image. Time is either a number of seconds, or hours, minutes and seconds separated by colons. Without a thumbtime parameter, a frame from the midpoint of the video is used by default. For instance, using the same video file as previously:
File:Cat.mp4
Man in suit tie and hat at 21 seconds. Time syntax using seconds only: "21".
File:Cat.mp4
Monoplane seen at 23 seconds. Time syntax using minutes and seconds: "0:23".
File:Cat.mp4
Landed biplane seen at 33 seconds. Time syntax using hours, minutes and seconds: "0:0:33".

Displaying small videos larger

To display a video larger than its uploaded size use "|thumb" and "|numberpx". This may be useful if the original video is very small but shows some important but small detail, but note that upscaling may create unexpected scaling artifacts. For example, the code

[[File:cal16x16check_vdnocnoafr1len2.avi.q10.ogv|inline|left]] [[File:cal16x16check_vdnocnoafr1len2.avi.q10.ogv|right|thumb|128px]]

displays the 16 pixels wide video at its original size on the left and eight times wider at the right (the squares should be all black or all white and the edges should be sharp — any blurriness or off-white colour is likely due to the browser or the Wikimedia server rendering):

inline
inline
File:Cal16x16check vdnocnoafr1len2.avi.q10.ogv

Thumbtime in a gallery

The thumbtime parameter can also be used inside a gallery (either with <gallery> tags or the {{Gallery}} template):

Here is the wikicode that created it:

<gallery>
File:First flights in aviation history.ogg|thumbtime=21|Man in suit tie and hat at 21 seconds.
File:First flights in aviation history.ogg|thumbtime=0:23|Monoplane seen at 23 seconds.
</gallery>

See also