Basic images

From Gamepedia Help Wiki
Jump to: navigation, search
C1 images.png C2 images.png

No worries, help is on its way!

This page explains the basics of image syntax when editing the wiki. You or another user must usually upload an image before you can use it on a page. Sometimes it can become very useful to know at least a few basics of Image Manipulation.


Images that are stored on a MediaWiki server are usually rendered by using the File: namespace prefix (but the legacy Image: namespace prefix is still supported as a synonym) as the target of a MediaWiki link. The alternate Media: namespace prefix is also usable to reference the original media file content (for rendering or downloading it separately, out of any MediaWiki page).

Supported media types for images[edit | edit source]

NOTE:
Prof hydra.svg The maximum filesize for an image is 8 MB,
and the maximum size in pixels is 5000px x 5000px.

The following file formats are supported by default:

  • .jpg or .jpeg : bitmap image compressed in the standard JPEG format (this lossy format is most suitable for photographs).
  • .png : bitmap image in the Portable Network Graphics format (specified by the W3 Consortium).
  • .gif : bitmap image in the legacy Graphics Interchange Format. Animated gifs work, too.

Other formats can used, but may require extra set-up beyond what is enabled by default) such as .svg, .tiff, .ogg, and .pdf. For more information, check the Advanced Images page.

Rendering a single image[edit | edit source]

Syntax[edit | edit source]

NOTE:
Prof hydra.svg The image will always retain its aspect ratio, and can only be reduced (not increased)
in size unless it's in a scalable media type (bitmap images cannot be scaled up).

The basic syntax for displaying an image is:

[[File:filename.extension]]

The full syntax for displaying an image is:

[[File:filename.extension|options|caption]]

Options can be zero or more of the following, separated by pipes (|):

  • Format option: one of border and/or frameless, frame, thumb (or thumbnail);
    Controls how the rendered image is formatted and embedded in the rest of the page.
  • Resizing option: one of
    • {width}px — Resizes the image to fit within the given maximum width in pixels, without restricting its height;
    • x{height}px — Resizes the image to fit within the given maximum height in pixels, without restricting its width;
    • {width}x{height}px — Resizes the image to fit within the given width and height in pixels;
    • upright — Resizes an image to fit within reasonable dimensions, according to user preferences (suitable for images whose height is larger than width).
  • The default maximum size depends on the format and the internal image dimensions (according to its media type).
  • Horizontal alignment option: one of left, right, center, none;
    Controls the horizontal alignment (and inline/block or floating styles) of the image within a text (no default value).
  • Vertical alignment option: one of baseline, sub, super, top, text-top, middle, bottom, text-bottom;
    Controls the vertical alignment of a non-floating inline image with the text before or after the image, and in the same block (the default vertical alignment is middle).
  • Link option: one of
    • link={target} — Allows to change the target (to an arbitrary page title, or URL) of the generated link, activable on the rendered image surface; e.g. [[File:Hydra intro.png|40px|link=//wikipedia.org]] renders as Hydra intro.png (external link), or [[File:Hydra intro.png|40px|link=MediaWiki]] renders as Hydra intro.png (internal link).
    • link= (with an empty value) — Displays an image without any activable link; e.g. [[File:Example.jpg|40px|link=]] renders as Hydra intro.png.
      • ! If you set |link=| (empty), then no title will be rendered.
  • Other specific options:
    • alt={alternative text} — Defines the alternative text (maps to the HTML attribute alt="..." of the generated <img /> element) of an image that will be rendered if either the referenced image cannot be downloaded and embedded, or if the support media must use the alternative description text (e.g. when using a Braille reader or with accessibility options set by the user in its browser).
    • page={number} — Renders the specified page number (currently only applicable when showing a .djvu or .pdf file).
    • class={html class} — (MediaWiki 1.20+) Defines classes (maps to the HTML attribute class="..." of the generated <img /> element)

If a parameter does not match any of the other possibilities, it is assumed to be the caption text. Caption text only shows below the image in thumb and frame formats. Caption text displayed in the thumb and frame formats may contain wiki links and other formatting. In the other options, wiki-formatting will not work though transclusion will.

If no caption text is supplied, a caption is automatically created showing the file name. To completely remove the caption, set it to <span title=""></span>. For example, [[File:Hydra intro.png|40px|<span title=""></span>]] renders as .


Please, click here, to find out more about:
Formats ♦ Galleries ♦ Links