Chapter 9. Images, Templates, and Special Characters

Articles on Wikipedia can include more than simply text. Images and media files enhance content whereas templates (such as the ubiquitous infoboxes) and tables can help you lay out articles more cleanly. Well-chosen graphics and neat presentations can improve articles significantly. You can also use a number of formatting tricks. For example, you can use some HTML successfully, display special characters, and add mathematical formulas to articles. These tasks all use advanced wikisyntax, which will be covered in this chapter.

Our best advice is to learn the more advanced syntax options when you need them. Much of what is covered in this chapter, particularly information about template syntax, is not usually necessary for basic editing, but you can generally learn how to apply these enhancements quickly if you want to use them to improve an article.

Images and media files are a welcome contribution to Wikipedia and complement article text in multiple ways. Images might be illustrations, diagrams, photographs, or maps; they can show the reader what an animal looks like, where a country is, or give a sense of a city's skyline. Media files might include sounds, such as the pronunciation of an unfamiliar word or a short clip of a composer's work, or videos, such as an animation of how a machine works. What all of these files have in common is that they exist to illustrate and clarify article text. Images should not be placed in articles simply for the sake of adding a pretty picture, but a good, clear image of the subject—or an appropriate sound or video file—can greatly enhance any article.

Like all other Wikipedia content, all media and images must be freely licensed. Though today you can find digital images everywhere on the Web, by and large you can't use these images directly in Wikipedia; such use is generally a copyright violation, much like copying someone else's text and uploading it as your own. A better tactic is to take photographs or produce drawings and diagrams yourself, license them freely, and then upload them to Wikipedia for use in articles.

In this section, we'll talk about how to find images on Wikipedia, how to upload your own work for use on the site (and the licensing guidelines to keep in mind when doing so, including whether you can claim a fair use rationale), and then how to embed images in pages, using the special image syntax. We'll then discuss media files such as sound and video clips.

Any discussion of images is incomplete without mentioning one of Wikipedia's sister projects, the Wikimedia Commons (http://common.wikimedia.org/), which serves as an image and media file repository for all of the Wikimedia projects. These days uploading and working on images on Commons, where images are more easily reusable and searchable, rather than on Wikipedia directly is preferable. A more detailed description of this project can be found in Chapter 16.

As of early 2008, Wikipedia and the Wikimedia Commons had well over 3,000,000 images. With this many images, you can most likely find existing images to use in your article. If not, anyone is welcome to upload new images to the site, as long as the images can be used in an article and are freely licensed.

The Wikimedia Commons is probably the best place to start searching for images or media files. The easiest way to search is to use the Mayflower search engine ( you'll find a link to it on the front page of Commons); Mayflower searches image description pages on Commons for your keywords and returns a page of thumbnail-size pictures as search results. You can also go to Commons to browse media files and images by subject, as most images have been categorized extensively.

On Wikipedia itself, you can also browse images using categories. The topmost category for images is [[Category:Wikipedia images]]; this category also contains images that are only used as part of the Wikipedia project (rather than in articles), such as images for WikiProject awards. Under this category you'll find [[Category:Wikipedia images by subject]] and [[Category:Wikipedia images by type]], which sorts images based on whether they are drawings, animations, and so on. One image collection especially worth visiting is [[Wikipedia:Featured pictures]], which is a selection of some of the very best images on Wikipedia; here you can find the picture of the day and participate in image judging.

Finally, you can also search image descriptions directly on Wikipedia by searching the Image namespace, as described in Chapter 3. Whether you get any results depends entirely on how well the image has been titled and described.

If you enjoy contributing images and want to help track down needed pictures, there are two places to look for requests for pictures: [[Category:Wikipedia requested images]] on Wikipedia and [[Commons:Picture requests]] on Commons.

If you can't find an existing image for your article, you can upload a new one. But first make sure the license is acceptable. You shouldn't upload images to Wikipedia without knowing the license restrictions or without permission. All images you upload to Wikipedia must meet one of four criteria:

Playing fast and loose with the rules is very unhelpful. Do not copy images you find on the Web and call them your own. Although disregarding these points and uploading technically works anyway, many Wikipedians monitor the list of new image uploads, and without a proper license, the image will not remain on the site for long (typically, it will be deleted within a week).

The last of the criteria, fair use, is only accepted on the English-language Wikipedia (not on Commons) and is quite controversial, causing much discussion over the years. Under US copyright law, the term fair use refers generally to a limited use of a copyrighted work for educational or critical purposes. For instance, when a reviewer quotes a small segment from a book he or she is reviewing, the reviewer can do so because of fair use. On Wikipedia, the so-called fair-use policy documents when it is acceptable to use a non-free image on the site. For example, album covers appear in several articles about albums. Cover art is typically copyrighted, but the fair-use policy may mean that a small scanned image of the cover is acceptable so long as the album artwork itself is critically discussed in the article and an image of the artwork is necessary to help clarify this discussion.

Fair use is controversial on Wikipedia because the site aims to include only free content; including any copyrighted material at all is problematic given Wikipedia's license and values, and the legal aspects of what is and isn't fair use can be very difficult to determine. Given this, so-called fair-use images are only used in a very limited range of circumstances. If there is any possibility a free equivalent to a copyrighted image could be obtained instead at some point in the future (for instance, if the copyrighted image is of a living actor and another photographer might donate an equivalent photo), then the copyrighted image should not be used.

The full details of fair use on Wikipedia for images and media are something of a mouthful and are explained on [[Wikipedia:Non-free content]] (shortcut WP:NONFREE). Ten points are involved:

Even so, fair-use images are often culled and deleted from the site.

The best alternative to fair use is to find a free image instead, in line with the site's mission of promoting free culture. For instance, for celebrities or politicians, releasing a single PR photo into the public domain (or under the GFDL) ensures that Wikipedia can use that picture free and clear, and everyone benefits.

Images must be uploaded before they can be used on the project. You can't link to images on other websites. Images can be uploaded directly to Wikipedia, or alternatively to the Wikimedia Commons, where they may be used by all Wikimedia projects (not just the English-language Wikipedia). The latter option is preferable. A description of how to upload to the Commons, which is quite similar to the process described next, is in Chapter 16.

To upload an image, you must be logged in to the site. Click Upload File on the left-hand sidebar or visit [[Special:Upload]].

The steps are simple:

  1. Save the image or file you wish to upload to your computer.

  2. Click Upload File on the left-hand sidebar and indicate how you got the image. Depending on the option selected, you'll be led through a series of licensing questions to answer before you get to the uploading form.


  3. Once you reach the uploading form, scroll down past the warnings on the page to the form itself (Figure 9-1).

  4. Fill in the Source filename field; this field is for your original file. Click Browse to access the image on your computer. Once you've found the file, select it and click Open. The filename will then appear in the Source filename field.

  5. Select the destination filename; this is the name the file will have on Wikipedia or Commons (this name will be prefaced by Image: automatically). The filename for the image on your computer is used by default, but you can edit the name to change it (see the advice on naming files below). Remember that image filenames, unlike article titles, cannot be changed once you've named them, so choose carefully.

  6. Describe the image in the Summary field. What is the image of? When was the photo taken or the drawing created? Include as much useful information as you can—this is the only way that people searching for images will be able to find yours. This field may be pre-filled in with a template, depending on which option you chose in step 1; if so, you can fill out the appropriate parameters.

  7. Choose the appropriate license; if you select I don't know, your image will be deleted.

  8. Leave Watch this page checked; this way, you'll notice if the image has been tagged for deletion.

  9. Click Upload File. You're done!

The image now resides in the Image namespace, using the filename you've given it. Once you've successfully uploaded an image, you'll be taken to its image description page; this page is located at http://en.wikipedia.org/wiki/Image:yourimagename.jpg, where yourimagename.jpg is the filename you entered in the Destination filename field. This page is also where your summary description of the image appears. Once an image is embedded in an article, anyone clicking it will be taken to this page (note that if you click an image from Commons, you will automatically see the description page from Commons instead). The information and description on this page can be edited like any other page. To link to an image description page directly (rather than displaying the image), add a colon (:) before the filename in the wikilink:

[[:image:yourimagename.jpg]]

Files should be named descriptively; do not use a meaningless string of numbers and letters (such as you might get from a digital camera) or filenames such as image.jpg. Image filenames should clearly indicate the subject of the image, and image descriptions should clearly indicate the subject of the image, the photographer or image creator, and the image source. Other information that will also help document the image includes the date the image was taken, location, occasion, and so on. An image is often used in multiple articles, and obviously you have no more say in its use than any other editor does.

Though you cannot change an image filename after uploading it, you can replace an image by uploading a new version of the image with the exact same name; this change will show up in the image history. For an existing image, click the Upload a New Version of This File link, which appears under File history on the image description page.

Once you've uploaded an image, you can insert it on a Wikipedia page. Use the following syntax to insert an image on a page:

[[Image:nameofimage.jpg]]

This will display the image on the page, at the same size as the original.

Images may be floated to the left or right of the text. Laying out images on the right is more conventional for articles, though right-left alternation may also make sense, depending on the design of the article and the number of images used. For instance, standard infoboxes tend to be placed in the top-right part of an article, which will affect article layout. For an example of an article using multiple images, see [[Mandelbrot set]], where numerous techniques are used to display and arrange images.

You can set image alignment by adding a parameter using the vertical bar or pipe character (|):

[[Image:nameofimage.jpg|left]] or [[Image:nameofimage.jpg|right]]

You can also display an image as a thumbnail, which will automatically size the image to 180 pixels with space for a caption at the bottom, using the thumb parameter. You do this by adding two parameters:

[[Image:nameofimage.jpg|thumb|This is an image caption]]

This is an image caption will, in this case, display below the image. Captions should describe an image completely; they can include internal or external links as necessary. You can also combine this with the alignment parameter:

[[Image:nameofimage.jpg|right|thumb|This is an image caption]]

This aligns the image on the right side of the page in a handy thumbnail size with a caption below it.

Rather than using the default thumbnail sizing, images can also be sized to any dimensions:

[[Image:nameofimage.jpg|300px|left|This is an image]]

This will display the image at 300 pixels, left-aligned, with This is an image displayed as alternative text when a reader hovers the mouse over the image. To add this text as a caption to an image of any size, use the thumb tag with a size parameter:

[[Image:nameofimage.jpg|thumb|300px|This is an image]]

If you have many small images and you want to display them together, try using the <gallery> tag. Simply list the images you want to include in the gallery between two gallery tags, as follows:

<gallery>
Image:Wiki.png|Caption
Image:Wiki.png|Caption
Image:Wiki.png|Caption
Image:Wiki.png|Caption
Image:Wiki.png|Caption
Image:Wiki.png|[[Help:Contents/Links|Links]] can also be put in captions.
</gallery>

This will display these six images in a neat table. No double brackets are needed around filenames in an image gallery. Find out more at [[Wikipedia:Gallery tag]].

If you want to include a particularly wide image, such as a panorama of a city skyscape, use the template [[Template:Wide image]]. Full details are included on the template page.

As for which images should be included in an article, Wikipedia's image policies mainly deal with copyright concerns. The guideline at [[Wikipedia:Images]] does define what encyclopedic images are: An encyclopedic image is relevant to the subject at hand, clear, and good quality. Don't overwhelm your articles with images; using the thumbnail feature also ensures that pages will load more quickly for readers. The Featured Pictures project lays out more criteria for good images at [[Wikipedia:Featured picture criteria]]; many of these criteria are related to the technical quality of the image. For help improving images, you can always ask fellow editors interested in images—try the Wikipedia Graphics Lab project at [[Wikipedia:Graphic Lab]].

Other media files may also be used on Wikipedia. Audio files can be very helpful for some topics; for example, Wikipedia has numerous files designed to help you pronounce Chinese names properly. Chapter 3 covers how to play these files. Sound files must use the free Ogg Vorbis or the MIDI format, and video files must use the Ogg Theora format.

Considering approximately 70,000 articles are devoted to albums and singles, you might expect Wikipedia to have many music files. All music samples from copyright sources, however, have to be specifically tied into the article's description of a song or piece of music. Articles about albums are meant to inform, not to promote.

The fair-use policy also applies. The article on Bob Dylan's "All Along the Watchtower" does include a 14-second sample from the song. This short length conforms to the fair-use policy: The sample has to be minimal and not affect legitimate commercial trade.

Media files, such as sound files, are uploaded in the same way as image files. But when you link to them you replace Image with Media:

[[Media:nameoffile.ogg]]

Though you can upload PDF files, they do not generally play a useful role on Wikipedia or the other Wikimedia projects.

To identify a sound link in an article, you can use [[Template:Listen]], which adds a small sound icon and a handy menu for playing the file, as described at [[Wikipedia:Creation and usage of media files]].