Help:Pictures
Template:Short description Template:For-multi
- REDIRECTTemplate:Distinguish
Template:Rcatsh Template:Wikipedia how-to Template:Beginner version
This tutorial explains how to insert pictures into Wikipedia articles using wikitext. This is one of the most frequently asked questions. It describes options for specifying placement, alt text, captions, sizes and links, and contains advice about panoramas and avoiding image stackups. There is also a technical document describing the syntax and a simple guide for beginners. The same syntax is used regardless of whether a file is from Wikipedia or Wikimedia Commons.
If you need help uploading an image, or selecting a suitable image for an article, see the image use policy and the Manual of Style. Images on most websites are copyrighted and should not be uploaded; see the copyright policy. Please upload the highest resolution image possible, but keep the file size under 1,000 megabytes.
Before you add an image to an article, view the image's image description page to make sure its copyright status is clearly stated, preferably with one of the image copyright tags. Template:Sidebar with collapsible lists
Infobox pictureEdit
If an article already has an infobox at the top right, then the usual place for the article's first picture is within the infobox. For guidance on the syntax for doing this, see Help:Infobox picture. In very brief summary, one hurdle that trips up many people when attempting to add an image to an infobox template is that most internally provide the wiki code that "wraps" the image. Accordingly, you do not usually add the brackets, number of pixels, and other code details you will learn about below, when placing an image in infoboxes – just the file name next to a field labeled | image =. Adding such extraneous code will cause many infoboxes to break. Also, be aware that some infoboxes require that the file's name be placed without the file/image namespace prefix. Thus, and for example, if File:Name.jpg does not work, try just Name.jpg.
Thumbnails Edit
An existing English Wikipedia or Wikimedia Commons image can be inserted into a page with the basic wikitext <syntaxhighlight lang="wikitext" inline>
</syntaxhighlight>.Template:Efn Using Template:Param value generates a thumbnail picture, typically sized differently from the original image. For guidance on the caption text to associate with images, see Wikipedia:Manual of Style/Captions. Several options can affect a thumbnail's placement and size, described below.
Text wrappingEdit
The next two subsections describe how to add images with text wrapping. Template:A note It is strongly recommended to place the image on its own line rather than inline with text, as inline placement may disrupt paragraph formatting.
On the left Edit
By default a thumbnail is floated to the right of the page, with the text flowing around it. However, our first example specifies Template:Param value with Template:Param value. Just below the example you can see what the resulting picture looks like:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
The above text gives the image file name Template:Mono, the image type Template:Param value and alignment Template:Param value, the alt text "A cartoon centipede reads books and types on a laptop.", and the caption "The Wikipede edits Myriapoda." A Wikipedia reader can click on the thumbnail, or on the small double-rectangle icon File:Magnify-clip.png below it, to see the corresponding file page which will let the user see the image in its original size.
Although the above text may appear in multiple lines for formatting purposes, the actual image text is on one line, as it uses spaces without any line breaks. The [[
and the first |
must be on the same line; other spaces and line breaks are ignored if they are next to |
characters or just inside the brackets. Some parts of the image syntax, such as the alt=
, do not allow spaces or line breaks, and the easiest way to get it right is to omit unnecessary spaces and line breaks.
Alt text is intended for visually impaired readers. Often the caption or article will describe the image adequately, and where this is the case you can write alt=caption
or preferably more specificity for example: alt=toothbrush|caption=A picture of a red toothbrush
. If additional alt text is added, it should be a succinct description that complies with the content policies; see WP:ALT for accessibility guidelines and Help:ALT for examples. Unlike alt text, a caption can contain Wiki markup like ''[[Myriapoda]]''
. The caption text is placed underneath the picture.
Here is the same example again, this time in the context of some colored lorem ipsum dummy text with asterisks (Template:Xtn) indicating where the image syntax appears in the text:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.
Avoid referring to images as being "on the left". Image placement is different for viewers of the mobile version of Wikipedia, and is meaningless to people having pages read to them by assistive software. Instead, use captions to identify images.
On the right Edit
The default placement for a thumbnail is on the right:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
Template:Lorem ipsumTemplate:Xtn
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.
Avoid referring to images as "being on the right". Image placement is different for viewers of the mobile version of Wikipedia, and is meaningless to people having pages read to them by assistive software. Instead, use captions to identify images.
Without flowing textEdit
Although most thumbnails are combined with flowing text and are placed to the right or left, you can also place a thumbnail without text flowing around it. One way is to center it, using Template:Param value or Template:Param value:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
Template:Lorem ipsumTemplate:Xtn
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.
You can also place the picture to the left, without flowing text, using Template:Param value:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
Template:Lorem ipsumTemplate:Xtn
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.
Thumbnail sizesEdit
Template:See also Template:Ombox By default, thumbnail images on Wikipedia have a width of 220 pixels (px) if the image's wikitext does not have an explicitly defined size. This is the width determined by default that is used by anonymous visitors and users who have not customized their preferences. You can set a different default width for yourself in My preferences under "Appearance » Files". The options are 120px, 150px, 180px, 200px, 220px, 250px, 300px, and 400px. Any image narrower than the preferred width is displayed at its actual, narrower width, without being stretched to fill the preferred width.
Images with text should generally use a caption and the thumb
(thumbnail) option; the default results in a display 220 pixels wide (170 pixels if the upright
option is used), except for those logged-in users who have set a different default in their user preferences. In general, do not define the size of an image unless there is a good reason to do so. Some users have small screens or need to configure their systems to display large text; "forced" large thumbnails can leave little width for text, making reading difficult. In addition, forcing a "larger" image size at say 260px will actually make it smaller for those with a larger size set as preference.
Sometimes a picture may benefit from a size other than the default; see the image use policy for guidance.
- Normally the size should be specified as a value relative to the user's preferred base size, using the Template:Para parameter rather than pixel values.
- Where size forcing is appropriate, larger images should generally be no more than 500 pixels tall and 400 pixels wide, so that they can comfortably be displayed on the smallest displays in common use.
- Lead images should usually be no wider than 300px. That is equivalent to using
upright=1.35
if the default thumbnail width is 220px (220 multiplied by 1.35 then rounded to the nearest multiple of 10 equals 300), but larger defaults in user preferences will result in proportionally larger images (340px if the default is 250px, 410px if the default is 300px, or 540px if the default is 400px).
Since the MediaWiki software dynamically scales inline images, there is no technical reason to reduce file size via scaling or quality reduction when uploading images, although non-free images may require scaling due to copyright concerns (see the non-free image resolution guidelines for further information). Also, compressing PNGs may be useful, because PNG files can be safely resized without losing quality.
The default behavior can make a tall, thin picture come out too large. For example:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
File:Amun.svgThe Egyptian god Amun, portrayed before the Amarna period
Upright images Edit
The upright
option can help fix this by informing the Wikipedia layout system that the image should have a narrower width than usual:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
File:Amun.svgThe Egyptian god Amun, portrayed before the Amarna period
The upright
option normally creates an image that is about 75% of the width of the default. The exact width is computed by starting with the default thumbnail width, multiplying it by 0.75, and rounding to the nearest multiple of 10. Normally the default width is 220px so an upright image is 170px wide; changing one's default width within the range from 120px to 400px results in upright image widths ranging from 90px to 300px.
Shrinking upright images furtherEdit
If the upright factor 0.75 is too large or too small, it can be specified explicitly. A factor of 1.0 uses the default thumbnail width, which is the same as not specifying upright
at all with the thumb
option; a factor less than or greater than 1.0 creates an image smaller or larger than the default. For example:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
File:Amun.svgThe Egyptian god Amun, portrayed before the Amarna period
Short, wide imagesEdit
Short, wide images sometimes benefit from upright
factors greater than 1.0. Factors greater than about 2.5 can generate large images that cause problems with some browsers; for one way to handle wider images, see Panoramas below. For example:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
File:Köppen-vereinfacht.svgMacroclimates of Earth. Tans represent desert, dark greens humid continental, and light green tropical rainforest. Light blue and white represent tundra and ice cap.
Be careful not to overstretch images for which the original file is quite small (except with SVG images, see below). If the original file is 120 pixels wide, and it's stretched beyond that, the pixels making it up will start to be visible.
SVG images are an exception: Being vector images, they have no pixels, just instructions on how to draw the image that can be scaled up indefinitely, and the "image size" in the file description is arbitrary.
Width in pixels Edit
You can also display an image of a specified width. Typically, if you specify a width in pixels, it should be at least 300px. Widths greater than about 550px may cause problems with some browsers, as stated above.
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
Height in pixelsEdit
To specify the exact height of a picture, letting the width scale to match, prefix the height with x
. The following example resizes the image to a height of 60px:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
Width or height in pixels, whichever makes the image smallerEdit
If you specify both width and height of a picture, it is sized to whichever value would make it smaller. This will cause a picture to fit in a certain area, regardless of the image's actual size. Since the proportions of File:Flag of Scotland.svg are 5×3, specifying a width of 120px generates a 120×72px image, and specifying a height of 60px generates a 100×60px image, so a size field of 120x60px
generates the smaller of the two, namely, the 100×60px image:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
Pixel counts vs. upright factorsEdit
Despite its name, the parameter "upright" is now used for both tall and wide images. Although pixel counts are easier to understand than upright factors, they adjust less well to user preferences. For example, suppose a picture contains some detail and by default is a bit too small, and you want to increase it by about 10%. Although upright=1.1
and 240px
do the job equally well for the common case where the default width is 220 pixels, many of the users who set the default width to 300 pixels to work better with their high-resolution screens will be annoyed with 200px
because it will make the picture a third smaller than their preferred size. In contrast, upright=1.1
will display the picture to them with a width of 330 pixels, and this is more likely to work well on their displays.
To clarify, "upright=0.75" is equivalent to "upright", and "upright=1" leaves the image at its default size (220px when not logged in), equivalent to not using "upright" at all. For convenience, a few conversions are as follows:
upright scale |
px size (default) |
---|---|
0.2 | 40px |
0.25 | 60px |
0.5 | 110px |
– | 170px |
0.75 | |
1 | 220px |
(not used) | |
1.25 | 280 |
1.35 | 300 |
1.5 | 330 |
1.8 | 400 |
2 | 440 |
2.25 | 500 |
2.5 | 550 |
Pixel counts are typically better than upright factors for displaying combinations of pictures, some of which have known and limited sizes, and for displaying tiny icons that are intended to be combined with text.
Native sizeEdit
Replacing thumb
with frame
causes the image to be displayed in its native size, that is, the size that it was originally uploaded with. This use is obsolete and should not be used because it is disruptive for many displays, especially mobile devices. Instead, if an article would be better with pictures resized in some way other than the default, use the "upright" parameter. Users should set their own preferences if they want pictures resized and article authors should not do this. If anyone has a justification for using the frame feature then please share on the talk page. For historical reference, here is an example of it being used:
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
PanoramasEdit
Very large pictures should not be put directly into articles, as they cause problems in some browser environments. Images wider than 550px or so are often better treated as a panorama, which can be created with the Template:Tl template. For example:
<syntaxhighlight lang="wikitext">Template:Wide image</syntaxhighlight> Template:Wide image
DjVu and PDF filesEdit
Images can be excerpted from DjVu or PDF files, with an optional page parameter. For example:
<syntaxhighlight lang="wikitext" style="font-size: 80%;">
</syntaxhighlight> <syntaxhighlight lang="wikitext" style="font-size: 80%;">
</syntaxhighlight>
Avoiding stack-upsEdit
{{#invoke:Shortcut|main}} Template:See also
One of the problems many users of floating pictures hit is that multiple pictures sometimes stack up vertically, particularly with large screens and wide images. For example, in many browsers the two pictures at the right of this text stack up awkwardly.
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.File:Flag of Scotland.svgFlag of Scotland
Often the best solution to this is simply to add more text, as is done below, but this sometimes is not possible. The following subsections show some other possible solutions to the problem.
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.File:Flag of Scotland.svgFlag of Scotland
Alternating left and rightEdit
Perhaps the easiest way to handle multiple floating pictures is to alternate them left then right (or right then left); this way they do not come into contact with one another, and so cannot stack up in an unattractive way. This has a disadvantage, though: people with very low screen resolutions (such as those using netbooks) may find the result too awkward, albeit still readable. This may also cause conflicts with WP:SANDWICH.
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.File:Flag of Scotland.svgFlag of Scotland
Co-aligningEdit
It is common to have two pictures that logically should be grouped together. The Template:Tl template is one way to do this. For example:
Template:Multiple image <syntaxhighlight lang="wikitext" style="overflow:auto;"> Template:Multiple image </syntaxhighlight>
The same template can also align pictures vertically:
Template:Multiple image <syntaxhighlight lang="wikitext" style="overflow:auto;"> Template:Multiple image </syntaxhighlight>
GalleriesEdit
Template:Warning {{#invoke:Labelled list hatnote|labelledList|Main article|Main articles|Main page|Main pages}} A gallery displays several pictures in an array or similar layout. Before making a gallery, read the image use policy for galleries. Generally, a gallery should not be added so long as there is space for images to be effectively presented adjacent to text.
Technically, a gallery can be produced in different ways. One simple and flexible method is table syntax. For example:
<syntaxhighlight lang="wikitext" style="overflow:auto;">
File:Philipp Veit 008.jpg Philipp Veit, Germania, 1834–36 |
File:Image Germania (painting).jpg Philipp Veit, Germania, 1848 |
File:Niederwald memorial 2.JPG Johannes Schilling, Germania, 1871–83 |
</syntaxhighlight>
File:Philipp Veit 008.jpg Philipp Veit, Germania, 1834–36 |
File:Image Germania (painting).jpg Philipp Veit, Germania, 1848 |
File:Niederwald memorial 2.JPG Johannes Schilling, Germania, 1871–83 |
Another simple way is the specialized Template:Xtag tag, which works like this:
<syntaxhighlight lang="wikitext">
- Wiki.png
Caption 1
- Wiki.png
Caption 2
</syntaxhighlight>
Which produces:
- Wiki.png
Caption 1
- Wiki.png
Caption 2
You can also specify alt text and other image rendering parameters like page number for pdfs: <syntaxhighlight lang="tid" style="overflow:auto;">
- William Blake, a critical essay (Swinburne).pdf
Book by Algernon Charles Swinburne
- William Blake, a critical essay (Swinburne).pdf
page=2
</syntaxhighlight>
Which produces:
- William Blake, a critical essay (Swinburne).pdf
Book by Algernon Charles Swinburne
- William Blake, a critical essay (Swinburne).pdf
page=2
The gallery tag also offers some parameters, such as widths, heights and mode among others. The full documentation is available at mw:Help:Images#Gallery syntax. For example:
<syntaxhighlight lang="tid" style="overflow:auto;">
- Galerella sanguinea Zoo Praha 2011-2.jpg
Galerella sanguinea (Slender Mongoose)
- Felis silvestris silvestris.jpg
- Six weeks old cat (aka).jpg
Felis silvestris catus (A Young Cat)
- Felis catus-cat on snow.jpg
Felis catus (cat on snow)
- Tired 20-year-old cat.jpg
Felis silvestris catus (Tired 20-year-old cat)
- Cat November 2010-1a.jpg
Felis silvestris catus (Cat)
- Felis silvestris silvestris Luc Viatour.jpg
Felis silvestris silvestris (European wildcat)
- June odd-eyed-cat cropped.jpg
Felis catus (Domestic cat)
- Lynx kitten.jpg
Lynx lynx (A Young Lynx)
</syntaxhighlight>
produces:
- Galerella sanguinea Zoo Praha 2011-2.jpg
Galerella sanguinea (Slender Mongoose)
- Felis silvestris silvestris.jpg
- Six weeks old cat (aka).jpg
Felis silvestris catus (A Young Cat)
- Felis catus-cat on snow.jpg
Felis catus (cat on snow)
- Tired 20-year-old cat.jpg
Felis silvestris catus (Tired 20-year-old cat)
- Cat November 2010-1a.jpg
Felis silvestris catus (Cat)
- Felis silvestris silvestris Luc Viatour.jpg
Felis silvestris silvestris (European wildcat)
- June odd-eyed-cat cropped.jpg
Felis catus (Domestic cat)
- Lynx kitten.jpg
Lynx lynx (A Young Lynx)
The Template:Tl template offers a third method:
<syntaxhighlight lang="wikitext">{{#invoke:Gallery|gallery}}</syntaxhighlight> {{#invoke:Gallery|gallery}}
Forcing a breakEdit
As a final resort, you can force the browser to insert a break, making all text and pictures appear below the bottom of the first picture. This can produce rather unattractive gaps, particularly in the accompanying text. Remember that text will flow and wrap differently for other users, based on their chosen browser, screen resolution, default font size, accessibility options, number of toolbars and sidebars (such as instant messaging panes) and more. Do not force page design just so that it looks pretty on your display. Hack only where absolutely necessary. Wherever possible, just use the simplest logical page flow.
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
File:Wikipedesketch.pngThe Wikipede edits Myriapoda.File:Flag of Scotland.svgFlag of Scotland
Plain picturesEdit
Most pictures in articles are thumbnails, but sometimes more specialized needs require finer grained control. A plain picture with no formatting can be inserted with:
[[File:Wikipedesketch.png|A cartoon centipede reads books and types on a laptop.]]
In this plain picture the text A cartoon centipede reads books and types on a laptop.
is not visible as a caption. Instead, it appears as the title text of the image, commonly displayed as a tooltip during a mouseover. In a thumbnail the alt text defaults to empty, but a plain picture's alt text defaults to its title text if given and to the picture's file name if not; this default can be overridden with an explicit alt=Alt text
option. Title text, like alt text, will ignore any Wiki markup.
A plain picture can be placed anywhere in the article, and acts as a big character in the text, so that nearby text does not float or wrap around it. For example:
*A cartoon centipede reads books and types on a laptop.*Template:Lorem ipsum
- Note: To achieve a plain image with a caption, one can use Template:Tl. The caption is automatically added as the image's title and alt text, and any wiki markup used on it will be correctly displayed on the caption, but will be automatically stripped down from the alt and title text. See an example here.
Plain picture sizesEdit
A plain picture defaults to the image's native size. This can be overridden with an explicit size. For example:
[[File:Wikipedesketch.png|50px|A cartoon centipede reads books and types on a laptop.]]
*A cartoon centipede reads books and types on a laptop.*Template:Lorem ipsum
The frameless
option causes a plain picture to default to the same size as a thumbnail. As with thumbnails, the default can be adjusted with the upright=factor
option. If you use the common default of 220 pixels for thumbnail widths, the following example image's width will be 220 × 0.2 pixels, which rounds to 40 pixels:
[[File:Amun.svg|frameless|upright=0.2|alt=Full-length profile of man in ancient Egyptian clothing. He has red-brown skin and wears a helmet with tall yellow plumes.|The Egyptian god Amun, portrayed before the Amarna period]]
BorderEdit
The border
option adds a one-pixel border, which can be useful when it is important to distinguish image from background. Here is the same picture with and without a border.
[[File:Flag of Japan.svg|border|30px|White flag containing solid red circle]]
[[File:Flag of Japan.svg|30px|White flag containing solid red circle]]
This generates Template:Nowrap.
Horizontal placementEdit
Like thumbnails, plain pictures can be floated left or right with text flowing around them; or centered or put left without text flow. The only difference is that the right
parameter is required to float a plain picture to the right, whereas floating right is the default for thumbnails. For example:
[[File:Wikipedesketch.png|right|A cartoon centipede reads books and types on a laptop.]]
Vertical alignmentEdit
When a plain picture appears in text, it is aligned so that its vertical middle is roughly where the center of a lower-case "x" would be; if the image is larger than the line is tall, it sticks out both above and below. The vertical alignment syntax provides several options to adjust this. For example, the baseline
option:
x[[File:Flag of Hungary vertical.svg|baseline|8px]]x
generates "Template:Nowrap" instead of the default "Template:Nowrap". Available options for vertical alignment, next to the output that they generate, are Template:Nowrap, Template:Nowrap (the default), Template:Nowrap, Template:Nowrap, Template:Nowrap, Template:Nowrap, Template:Nowrap, and Template:Nowrap.
LinksEdit
- You may be looking for inline linking to external images. This is not allowed; see the Wikipedia Manual of Style on inline linking.
Normally a picture links to its image page, which describes the image, who created it, and links to the original image at full resolution. This is usually best for the reader, and is often required by the uploader's choice of a CC-BY-SA license for the image.
If the image is in the public domain, not requiring attribution to the uploader, you can create a plain picture that links to some other location by using the link
option.
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:Flag of France.svg|20px|link=France|France]]
generates a flag France that links to the article France.
To link to an external site, specify its URL in the link option along with an appropriate caption. For example, [[File:Flag of Belgium.svg|20px|link=http://www.belgium.be/en/|Belgium government portal]]
generates a flag Belgium government portal that links to the English-language portal of the Belgian government.
To link to another Wikimedia site, use the site abbreviation. For example, [[File:Orcus symbol.svg|20px|link=wikt:🝿]]
generates File:Orcus symbol.svg, which links to the (English) Wiktionary entry for that symbol.
A purely decorative image, which conveys no information and does nothing when it is clicked on, can be specified with an empty alt attribute. For example, [[File:Flag of the United States.svg|20px|link=|alt=]]
generates a flag File:Flag of the United States.svg that is purely decorative. However, purely decorative files are only legally usable in this way if they are in the Public Domain or comply with WP:NFCC.
Image mapsEdit
<imagemap>
File:Bryan-Sewall.jpg|300px|right|alt=1896 Democratic campaign poster with nominees William J. Bryan of Nebraska for President and Arthur Sewall of Maine for Vice President
circle 950 850 700 William J. Bryan
circle 2950 850 700 Arthur Sewall
default 1896 Democrats
</imagemap>
You can link different parts of an image to different locations using an image map. For example, in the image at right, clicking a circle roughly corresponding to the left portrait takes the reader to William Jennings Bryan, clicking the right portrait goes to Arthur Sewall, and clicking anywhere else goes to http://projects.vassar.edu/1896/democrats.html
. This image is generated by the following markup:
<syntaxhighlight lang="tid" style="overflow:auto;"> <imagemap> File:Bryan-Sewall.jpg|300px|right|alt=1896 Democratic campaign poster with nominees William J. Bryan of Nebraska for President and Arthur Sewall of Maine for Vice President circle 950 850 700 William J. Bryan circle 2950 850 700 Arthur Sewall default 1896 Democrats </imagemap> </syntaxhighlight>
This imagemap markup specifies that the title text (tooltips) for the three regions are "William J. Bryan", "Arthur Sewall", and "1896 Democrats", respectively. The alt text for an imagemap region is always the same as its title text; the alt text for the overall image is given in the first line of the imagemap's markup. The underlying image's native dimensions are 3916×1980, and the coordinates are given in these dimensions rather than in the 300px resizing. As described in the image map documentation, regions can be specified as circles, rectangles, and arbitrary polygons, and the blue "i" icon File:Desc-20.png can be moved or suppressed. Also, the image can be specified as a thumb
or frame
, which means it has alt text and a caption in the usual way, with a double-rectangle icon File:Magnify-clip.png instead of the blue "i" icon File:Desc-20.png.
To do this easily, you can use a Commons gadget, called ImageMapEdit, by Dario D. Müller (ImageMapEdit_Howto). To use it, first you must enable ImageMapEdit (by clicking the check box) on the Preferences widget page (which is at the end of the second group of gadgets).
Then below a Commons image appears the ImageMapEdit > link, which activates the widget.
Let's look at the example of an eye, in which we will select the area of the pupil with a circle:
Copy the contents of Generated wikicode, on the clipboard. With Edit (source), paste the clipboard contents in the article (occasionally a template, and in this case: in this help) of Wikipedia, as appropriate. <syntaxhighlight lang="tid"> <imagemap> File:Eagle(owl)-eye.JPG|
circle 1028 717 299 Pupil
desc bottom-left </imagemap> </syntaxhighlight>
Add in the code (<imagemap> ...) of the image (already copied in the article) the width that you think is appropriate (in this case we have chosen 250px) in the line of the file name, as shown: <syntaxhighlight lang="tid"> <imagemap> File:Eagle(owl)-eye.JPG|250px
circle 1028 717 299 Pupil
desc bottom-left </imagemap> </syntaxhighlight>
The result will be: <imagemap> File:Eagle(owl)-eye.JPG|250px circle 1028 717 299 Pupil desc bottom-left </imagemap>
Try moving the mouse cursor over the pupil.
ImageMap is not enabled to contain a footer, for this reason we must include the above code in a table. For example:
<syntaxhighlight lang="tid">
<imagemap>
File:Eagle(owl)-eye.JPG|250px circle 1028 717 299 Pupil desc bottom-left </imagemap> |
Click the pupil Template:Small on the image of the eagle-owl eye. |
</syntaxhighlight>
<imagemap>
File:Eagle(owl)-eye.JPG|250px circle 1028 717 299 Pupil desc bottom-left </imagemap> |
Click the pupil Template:Small on the image of the eagle-owl eye. |
Overlaying annotations on an imageEdit
Some diagrams are uploaded without text, so that they can be used in multiple languages; or one may desire to add clickable links to an image. In such cases, text annotations can be added to an image with the templates Template:Annotated image or Template:Annotated image 4.
These templates allow wikitext (e.g., regular text, wikilinks, and reference 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.
Template:Annotated image | Template:Annotated image 4 | File:Wiwaxia body zones.png The image and caption as a thumb, sans annotations |
Dark modeEdit
For skeleton black and white images, it's possible to use the css "skin-invert-image" class, the colors will invert only in dark mode, as shown bellow:
<syntaxhighlight lang="wikitext">
File:Serotonin-2D-skeletal.svg</syntaxhighlight>
File:Serotonin-2D-skeletal.svg
For galleries, the <gallery> tag currently does not support adding classes to individual imagesTemplate:Efn, but this option is available in the {{gallery}} template.
Linking without displayingEdit
Let us say you want to link to the picture without displaying it. You can do it by adding a colon before the "File:" prefix. You can take them to the image page, where it tells them who uploaded it, when, what the copyright status is, etc.:
[[:File:Wikipedesketch.png]]
- File:Wikipedesketch.png
You can make the link say anything you want.
[[:File:Wikipedesketch.png|A cartoon centipede reads books and types on a laptop.]]
- A cartoon centipede reads books and types on a laptop.
When the link is clicked the image is displayed with other text information at a reasonable size. The user can click through the resulting medium-sized image to get to the full size highest resolution image.
You can also send the user directly to the image:
[[Media:Wikipedesketch.png]]
- Media:Wikipedesketch.png
This says Media:
instead of File:
. When the user clicks on the link, the browser goes directly to the image. As before, you can change the text so it says anything you want.
[[Media:Wikipedesketch.png|A cartoon centipede reads books and types on a laptop.]]
- A cartoon centipede reads books and types on a laptop.
This can be awkward if the image is quite large, for the full size image will be displayed when the user clicks the link.
Finally, you can link to one image from a thumbnail's small double-rectangle icon File:Magnify-clip.png, but display another image using "Template:Para". This is intended for the rare cases when the Wikipedia software that reduces images to thumbnails does a poor job, and you want to provide your own thumbnail. In the following example, the double-rectangle links to File:Anime stub 2.svg but the image displayed is File:Anime stub.png:
[[File:Anime stub 2.svg|thumb=Anime stub.png |alt=Head of cute girl, manga-style, with blue hair, big eyes and smile, and gray puzzle pieces below and around her hair |Putting the puzzle together]]
Image framesEdit
Multiple images can be displayed in an image frame: <syntaxhighlight lang="wikitext" style="overflow:auto"> Template:Image frame </syntaxhighlight> Template:Image frame They can also be cropped and stacked inside the frame:
<syntaxhighlight lang="wikitext" style="overflow:auto"> Template:Image frame </syntaxhighlight>
In case an image will not renderEdit
If the image will not render, and instead the wikicode is shown in the article, it may have the following causes:
- The image syntax is incomplete or incorrect.
- The caption may have incomplete link tags, especially unpaired [[s and ]]s that become interpreted as image syntax
- The previous image may have incorrect image syntax, especially an incomplete ]] at the end
- The capitalization in the wikicode must be followed; thus if an image file is Image:Photo of Wikipede.JPG, you will need to use the capital letters for "JPG".
- The image is blacklisted on MediaWiki:Bad image list. Consider requesting its removal at MediaWiki talk:Bad image list.
TipsEdit
- When placing or sizing images, it is often better to edit the entire page, rather than just one section, to avoid unexpected overlaps with other sections of the article.
- Before publishing any images, keep in mind that they can contain hidden data. This data can include comments that are not displayed, Exif metadata, and messages hidden via steganography.
- Images can be rotated, mirrored, scaled and cropped using the templates Template:Tl, Template:Tl, Template:Tl.
See alsoEdit
- Help:Files
- Wikipedia:Article wizard
- Help:Section – instructs how to position an article table of contents (TOC) within the image flow
- Template:Tl
- Wikipedia:Extended image syntax
- Wikipedia:Graphics Lab – assistance with editing or improving images
- Wikipedia:Graphics tutorials – how to make your own pictures
- Wikipedia:How to create charts for Wikipedia articles
- Wikipedia:How to improve image quality
- Wikipedia:Images
- Template:Section link
- Wikipedia:Manual of Style/Images
- Wikipedia:Media copyright questions
- Wikipedia:Preparing images for upload
- Wikipedia:SVG help
- Commons:First steps – tutorial
- Commons:File captions
- Commons resources category
- Free image resources – where to find free images for use in Wikipedia
- Wikimedia Bookshelf – more tutorials, videos, handouts
- mw:Extension:PageImages
NotesEdit
Template:NotelistTemplate:Help navigation Template:Wikipedia technical help