# Multimedia Systems/Multimedia Elements and File Formats

GraphicWikipedia Resource on Graphic Files
Audio Wikipedia Resource on Audio Files
Video Wikipedia Resource on Video Files
Text Wikipedia Resource on Text Files


## Images

On Wikimedia Commons, the file types we recommend are: SVG, PNG, JPEG, and XCF (GIMP).

BMP files are not allowed on Commons. These can be losslessly converted to PNG, and the file size will always be smaller.

### Size and scaling

Unfortunately the image scaling system is still limited. Currently, (PNG, GIF, JPEG) thumbnails are generated in the same format as the original image and are always in 24-bit color (unless the image is GIF, in which case the resulting image will have 256 colors). This means that scaling PNG images produces fairly large files even if the original image contained a palette, or was in grayscale format. This also means that if you want to upload a lossless PNG of a photo for editing and archival, but want to use JPEG thumbnails in articles, you have to upload a (full scale) JPEG version manually.

Note that scaling of images may fail if the image is very large and rendering takes too much time or memory (in that case, either no scaled image is shown, or the full image is served to the browser, often causing it to lock up). For PNG and GIF images, a hard limit of 12.5 megapixels is in effect.[Note 1] Large JPEGs are only problematic if they are saved in progressive mode; use baseline mode instead. Relatively large TIFF images may fail to thumbnail due to performance issues. (Ref: bugzilla:24984)

The scaling problem also means that care must be taken in creating clickable image maps. PNG can be bad for clickable image maps in many cases because of the previously-discussed PNG scaling problem with the MediaWiki software (see also Template talk:BadGIF). An unscaled clickable PNG image map may work out fine. But a scaled clickable PNG image map can be much higher in kilobytes. As in 100 kB versus 500 kB. In that case it may actually be better to create a GIF version of the map for this particular use as an image map. This way editors can use any size of the image map without problems. An "other versions" link to the full-color PNG map can be left on the GIF image description page.[Note 2] Please help ensure that Commons content can be reused widely — including use in printed media — by uploading photographic images at high resolution.

### SVG

SVG is an XML-based vector graphics format, so it can be scaled at will without getting blurry or "pixelated", is easy to edit, and usually produces reasonably small files. See Image:Bitmap VS SVG.svg. SVG is preferred when creating diagrams, flags, etc, while PNG is good for scanned images, or for print-quality photographs. You can find further information at Help:SVG and Commons:Transition to SVG.

SVG is good for diagrams, charts, illustrations, maps, and graphics of all kinds that need labels. This is because it is easy to change the text in the labels, and so it is easy to convert SVG images for use in all languages of Wikipedia. For example; see the map below labeled in several languages. Note that the image you are viewing is actually in the PNG format. SVG images stored at Wikipedia or on the Wikimedia Commons aren't actually what you see in your browser. MediaWiki converts the SVG image to a PNG image. The SVG format is the working format of the stored image so that people can more easily convert images for use in different languages. The source code of this SVG map below is valid. Compare the better image quality of the SVG maps at various sizes compared to the JPG and PNG maps. See Template:Other versions/Caucasus-ethnic for more versions of this SVG map in more languages.

### PNG

PNG is a lossless format (which supports alpha transparency), meaning that the exact pixel color is preserved when saving, and can be used for any kind of drawings/diagrams that is not available in SVG format (SVG is preferred when creating diagrams etc.). PNG is good for (practically anything but photos) scanned images, or for print-quality photographs, and low color depth images. (All this at a generally smaller size with more quality compared to JPEG.) These generally include flags, graphics, icons and certain screenshots.

In general, if you have a good image (JPEG or non animated GIF, that is in the wrong format), convert it to the PNG format before uploading. For further advice on converting JPEG to PNG, see Wikipedia:How to reduce colors for saving a JPEG as PNG.

### JPEG

JPEG is appropriate for “photographs”; JPEG uses "lossy compression", sacrificing precision for smaller file size.

If you have a choice of file formats in which to save a photograph, scan, or other such thing, save it as PNG (or save it as another lossless format, such as TIFF, and convert to PNG), and upload it as such. Even though PNGs over 12.5 megapixels cannot, at this time, be displayed on Wikipedia,[Note 1] the file will be able to be downloaded, and you can always convert the PNG to JPEG and upload that as an alternative. However, if the original file is in JPEG, it makes no sense to convert it to PNG: converting a lossy compression into a "lossless" format doesn't buy you anything since the "loss" already occurred in the original, and doing so will only increase the file size.

Note that currently JPEG thumbnails receive extra sharpening, while PNG thumbnails don't. Hence, uploading in both formats may be a good idea if the PNG thumbnails look a bit blurry.

PNG is a lossless full-color format. JPEG is always a lossy format even at the highest quality settings. Lossless formats do not degrade after being saved repeatedly, but lossy ones do; hence, having a lossless version of the file allows the file to be tweaked for various purposes — cropping, levels adjustment, and so on — without a loss in quality.

### GIF

GIF is a lossless, 8-bit color format (maximum of 256 colors) and should be used mainly for animated images on Wikimedia Commons. For animated images GIF uses lossless compression of images up to 256 colors per frame.[Note 3] Animated GIF files sometimes have problems when thumbnailed. If you find your animation corrupted or distorted when scaled down, try re-saving it with every frame the same size: A common optimization method in animated gif crunchers is to write variable-sized frames, sometimes labeled as: "Save only the portions of frames that have changed". Wikipedia's current version of ImageMagick does not seem to support this. There is currently a 12.5 megapixel restriction in our software;[Note 1] please see the description in Category:Animated gifs exceeding the 12.5MP limit for details.

PNG compared is almost always superior for still images, (means smaller size, more scalable, and more colorful, see the exception of clickable image maps discussed in the previous section). If you are creating or editing a graphic (not a photograph), and have a choice of file formats to save it in, the preferences for Wikipedia/Wikimedia use is SVG first, then PNG, and lastly GIF (for image maps). Never save an image with more than 256 colors in the GIF format (except for image maps for use on Wikipedia). GIF always saves images as 256 colors or less. Converting higher-color images to the GIF format will degrade those images.

Inline animations should be used sparingly; a static image with a link to the animation is preferred unless the animation has a very small file size. Keep in mind the problems with print compatibility mentioned above.

If you find some good free GIF graphics, diagrams, charts, maps, illustrations, etc. that would be useful for Wikipedia feel free to upload them to the commons as is. You, or others, can convert them to SVG later if need be.

See Commons:Chart and graph resources for tools and help

### TIFF

Only some TIFF files can, at this time, be displayed in resized (thumbnailed) form within Wikipedia or on Commons, and TIFF files are not supported by most Internet browsers. They are an archival format, and should never be used for images intended to be displayed.

TIFF generally serves as a lossless format, similar to PNG, but with much less compression. However, its standard compression algorithm is very fast to apply (which was a benefit on older computers) and most scanner software supports TIFF, making it a popular choice for archives.

PNG is not supported by most scanner software, but files saved in PNG can generally be made much smaller than TIFF files. For instance, one 33 MB TIFF reduced to 17 MB when saved as a PNG.

Overall, PNG should be preferred; however, the ability to upload TIFF files is offered as a courtesy. For instance, if you were batch scanning files in order to upload them to Commons for others to edit and prepare, you would want to use a lossless format (editing a non-lossless format causes an increase in artefacts every time you save). Your scanner software may not support saving directly to PNG, but allow TIFF. In such cases, uploading as TIFF is acceptable, as it helps you donate material to Commons much more easily. (In that specific case, it would be a good idea to inform the regulars on the Village Pump noticeboard so that your batch upload can be prepared for more widespread use, and possibly to discuss things beforehand briefly.) There are many image editors (free or commercial) that can handle conversion from TIFF to other formats. See: Comparison of raster graphics editors#File support.

The statements above apply to the vast majority of TIFF files; however, note that TIFF is a somewhat odd format - the specifications are loose, and can, in theory, support a wide variety of compression schemes and file storage (though most programs that open TIFFs only recognise the most common). This makes it difficult to make definite statements about TIFFs: For instance, TIFFs can contain JPEGs, which are not a lossless format. Generally, only TIFFs of the standard types should be uploaded to commons.

### XCF

XCF can usefully if you've made big changes to images with GIMP, and it can be assumed that others would like to change the image. Then it is partially (layers, text, …) very useful to upload the Gimp file so that others can continue working with it directly. In other formats text- and layer-information are lost. A thumbnail is not generated. Charge to be a version in jpg or png format (depending on the type of image) and link up the png / jpg version with the Gimp version and vice versa.[Note 2]

## Sound

On Wikimedia Commons, the file types we recommend are: Ogg (using FLAC, Speex, or Vorbis codecs) or MIDI (with extension .mid)

Non-free formats and lesser-known free formats must be converted before uploading - there is currently no legitimate way to store pristine original data for conversion to future formats or for use when patents expire, even if the license of a given work requires distributing such pristine original data (as is often the case for works distributed under the GNU Free Documentation License or other copyleft licenses).

Commons cannot accept MP3 sound files — there are numerous patent claims on MP3, making it illegal in some countries to use open source software with MP3, and even proprietary software companies are being threatened with various lawsuits.

The Commons also does not accept tracker formats, even formats written by free trackers. Nor does it accept sound fonts for use with MIDI files, even sound fonts designed for use with free MIDI players. If it is important that a musical passage be heard with specific instrument definitions that General MIDI does not provide for, and the license allows it, use your tracker software to render the passage to RIFF WAVE, and then encode it to Ogg Vorbis.

### MIDI

MIDI files are accepted, but not very well supported.

### Ogg

Speex is intended for recordings of speech, Vorbis is for general audio and is lossy (quality is reduced) — FLAC is for general audio and is lossless (quality is preserved), but current file size caps prevent its use for anything but short clips. In most cases, Vorbis should be used.

Do note that with FLAC, a native container format exists. If your output file has the extension. flac, it is likely using the native container format. You should not simply rename this to. ogg, instead you need to convert the container to. ogg.

Also useless is putting data in a non-free format like MP3 into a free container like Ogg: you get a file, which, while requiring that a player support the free container, still requires that it support the non-free codec.

#### Ogg Vorbis (audio)

Vorbis is a lossy audio codec. Also see the players for Ogg Theora videos below — they can also play Vorbis audio.

## Video

Videos must be Ogg files using the Theora video codec. Again, non-free formats must be converted before uploading.

### Ogg Theora (video)

Theora is a lossy video codec (see Theora). (Note: most software mentioned at Commons:Software should also be able to play Ogg Vorbis audio.)

## Scanned text documents (DjVu, PDF)

For allowable reasons of PDF and DjVu format, see Commons:Scope#PDF and DjVu formats.