Help:Images
Shortcuts H:IMAGE H:PICS |
This page explains how images work on Bulbapedia, and how you can add them to the wiki using wikicode in the Source Editor. For a guide on how images work in the VisualEditor, see Help:VisualEditor § Editing images.
Images are uploaded to, and stored on, the Bulbagarden Archives.
Supported file formats
Bulbagarden Archives allows the uploading of the following file formats:
.png
- Portable Network Graphics (PNG) files.jpg
or.jpeg
- JPEG files.gif
- Graphics Interchange Format (GIF) files
PNG files are the preferred file type, due to its lossless compression and a (generally) lower file size. The exception is for photographs, for which JPEG files are preferred. GIF files are to be avoided where possible; animated images should be uploaded as an Animated PNG.
More information about uploading files and best practice on the Bulbagarden Archives can be found at a:Help:Uploading images.
Rendering an image
The full syntax for displaying an image is:
[[File:filename.extension|options|caption]]
where options can be empty or containing one or more of the following lower-case words, separated by |
:
- Format option: border and one of frameless, frame or thumb (border can be used in combination with frameless but will be ignored if used with one of the other options).
- Resizing option: one of
- {width}px — Resizes the image to fit within the given maximum width in pixels, without restricting its height (only whole-number pixel values are supported).
- x{height}px — Resizes the image to fit within the given maximum height in pixels, without restricting its width (only whole-number pixel values are supported).
- {width}x{height}px — Resizes the image to fit within the given width and height in pixels (only whole-number pixel values are supported).
- upright — Resizes an image to fit within reasonable dimensions, according to user preferences (suitable for images whose height is larger than width). Setting
|upright=1.0|
will display the image at the user's default image width.|upright=2.0|
will display the image at double the user's default width. The image will always retain its aspect ratio.
- Horizontal alignment option: one of left, right, center, or none. If multiple of these options are present, only the first one will be used.
- Vertical alignment option: one of baseline, sub, super, top, text-top, middle, bottom, or text-bottom.
- Link option: one of
- link={target} — Allows to change the target (to an arbitrary page title, or URL) of the generated link, rather than linking to the file page.
- link= (with an empty value) — Displays an image without any activable link.
- Alternative text option: including alt={alternative text} allows for the inclusion of alternative text 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).
If a parameter does not match any of the other possibilities, it is assumed to be the caption text. If more than one non-parameter string is present, the final non-parameter string will be used as the caption. Caption text shows below the image in thumb and frame formats, or as tooltip text in any other format. Caption text displayed in the thumb and frame formats may contain wikilinks and other formatting.
If alt is not specified and a caption is provided, the alternative text will be created automatically from the caption, stripped of formatting, except when in thumb or frame mode since the caption is already readable by screen readers in that case.
Format
The following table shows the effect of all the available formats.
Description | Markup | Result |
---|---|---|
No format specified
|
... text text text [[File:Example.png|caption]] text text text ... |
... text text text |
border
(adds a very thin grey border)
|
... text text text [[File:Example.png|border|caption]] text text text ... |
... text text text |
frameless
|
... text text text [[File:Example.png|frameless|caption]] text text text ... |
... text text text |
frameless and border
|
... text text text [[File:Example.png|frameless|border|caption]] text text text ... |
... text text text |
frame
|
... text text text [[File:Example.png|frame|caption]] text text text ... |
... text text text
text text text ... |
thumb
|
... text text text [[File:Example.png|thumb|caption]] text text text ... |
... text text text
text text text ... |
Resizing
Among different formats, the effect of the size parameter may be different, as shown below.
- For how it appears when its size is not specified, see Format section above.
- When the format is not specified, or only bordered, the size can be both reduced and enlarged to any specified size.
- In the examples below, the original size of the image is 400×267 pixels.
- An image with frame always ignores the size specification; the original image will be reduced if it exceeds the maximum size defined in user preferences, and the page information will display a Linter error.
- The size of an image with thumb or frameless can be reduced, but cannot be enlarged beyond the original size of the image.
Horizontal alignment
Description | Markup | Result |
---|---|---|
No horizontal alignment specified
(default)
|
... text text text [[File:Example.png|100px|caption]] text text text ... |
... text text text |
none
|
... text text text [[File:Example.png|none|100px|caption]] text text text ... |
... text text text
text text text ... |
center
|
... text text text [[File:Example.png|center|100px|caption]] text text text ... |
... text text text
text text text ... |
left
|
... text text text [[File:Example.png|left|100px|caption]] text text text ... |
... text text text
text text text ... |
right
|
... text text text [[File:Example.png|right|100px|caption]] text text text ... |
... text text text
text text text ... |
Vertical alignment
The vertical alignment options take effect only if the image is rendered as an inline element and is not floating. They alter the way the inlined image will be vertically aligned with the text present in the same block before and/or after this image on the same rendered row.
Note that the rendered line of text where inline images are inserted (and the lines of text rendered after the current one) may be moved down (this will increase the line-height conditionally by additional line spacing, just as it may occur with spans of text with variable font sizes, or with superscripts and subscripts) to allow the image height to be fully displayed with this alignment constraint.
To show the alignment result more clearly, the text spans are overlined and underlined, and the font-size is increased to 200%; additionally, images of different sizes are aligned:
Alignment | Result |
---|---|
top | |
text-top | |
super | |
baseline | |
sub | |
middle
(default) |
|
text-bottom | |
bottom |
Stopping the text flow
On occasion it is desirable to stop text (or other inline non-floating images) from flowing around a floating image. Depending on the web browser's screen resolution and such, text flow on the right side of an image may cause a section header (for instance, ==My Header==
) to appear to the right of the image, instead of below it, as a user may expect. The text flow can be stopped by placing {{-}}
before the text that should start below the floating image.
All images rendered as blocks (including non-floating centered images, left- or right-floating images, as well as framed or thumbnailed floating images) are implicitly breaking the surrounding lines of text (terminating the current block of text before the image, and creating a new paragraph for the text after them). They will then stack vertically along their left or right alignment margin (or along the center line between these margins for centered images).
Links
The following table shows how to alter the link target (whose default is the image description page) or how to remove it. Changing the link does not alter the format described in the previous sections.
Description | Markup | Result |
---|---|---|
Internal link | ... text text text [[File:Example.png|link=Main Page|caption]] text text text ... |
... text text text |
External link | ... text text text [[File:Example.png|link=https://www.bulbagarden.net/|caption]] text text text ... |
... text text text |
No link | ... text text text [[File:Example.png|link=|caption]] text text text ... |
... text text text
text text text ... |
Warning:
- Bulbapedia relies heavily on copyrighted images. An image's description page displays the required authors attributions, copyrights statements, applicable licencing terms, and a more complete description of the rendered image (including its history of modifications). Removing links to this page when using a copyrighted image is not recommended and should be avoided whenever possible.
Galleries
Shortcut H:GALLERY |
Syntax
It's easy to make a gallery of thumbnails with the <gallery>
tag. The syntax is:
<gallery> File:file_name.ext|caption File:file_name.ext|caption {...} </gallery>
Note that the image code is not enclosed in brackets when enclosed in gallery tags. Captions are optional, and may contain wiki links or other formatting. The File:
prefix can be omitted. However, it is helpful to include it as an aid for quickly locating image specifiers in the wikitext (for example, when cleaning up page layout).
For example:
<gallery> File:Example.png|Item 1 File:Example.png|a link to [[Help:Contents]] File:Example.png File:Example.png|alt=An example image. It has leaves. File:Example.png|''italic caption'' File:Example.png|Links to external website|link=https://bulbagrden.net/ File:Example.png|link=Main Page|Internal link Example.png|on page "{{PAGENAME}}" </gallery>
Creates:
a link to Help:Contents
Optional gallery attributes
The gallery tag itself takes several additional parameters, specified as attribute name-value pairs:
<gallery {parameters}> {images} </gallery>
caption="{caption}"
: (caption text between double quotes for more than a word) sets a caption centered atop the gallery. Only plain text may be used in the caption; formatting, templates and the like will not work.widths={widths}px
: sets the (max) widths of the images; the default value is120px
. Note the plural: widths.heights={heights}px
: sets the (max) heights of the images; the default value is120px
.perrow={integer}
: sets the number of images per row.0
means automatically adjust based on width of screen.showfilename={anything}
: Show the filenames of the images in the individual captions for each image.
See also
Navigation | Navigation • Search • Tracking changes • Logging in • Watchlist |
---|---|
Editing | Editing pages • VisualEditor • Wikicode (Tables) • Images (Media Viewer) • Talk pages • Categories • Subpages • Cheatsheet |
Advanced | Starting a new page • Moving (renaming) a page • Merging pages • Splitting pages • Deleting pages • References • Special pages |
Templates | Using templates (Link templates • Color templates) • Creating templates (Magic words • TemplateStyles • TemplateData) • Lua (Crash course) |
Customization | Preferences • Skins • Custom CSS • User page • Signatures |
Archives | FAQ • Uploading images • Tagging images • Manual of style |
Introduction • FAQ • Editor's Hub |