Commons:File types

From Wikimedia Commons, the free media repository

(Redirected from COM:FT)
Jump to: navigation, search
This project page in other languages:

Alemannisch | Deutsch | English | Español | Français | Galego | Italiano | 日本語 | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Türkçe | +/−

Contents

Wikimedia Commons only accepts "free content"; likewise, ONLY free file formats are allowed.

Patent-encumbered file formats are not accepted at Wikimedia Commons. For a list of allowed file formats see the chapters below. Examples of patent-encumbered file formats are MP3, AAC, WMA, MPEG and most AVI codecs. Our mission requires content to be freely redistributable to all. Patent-encumbered formats fail to meet this standard.

Non-free formats must be converted to a free format before uploading. Fortunately, this is not usually difficult.

[edit] Summary of file types

[edit] 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.

Unfortunately the image scaling system is still very limited. Currently, 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 images, a hard limit of 12 megapixels is in effect. Large JPEGs are only problematic if they are saved in progressive mode, use baseline mode instead.

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 kilobytes versus 500 kilobytes. 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.

[edit] 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 megapixels cannot, at this time, be displayed on Wikipedia, 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.

See [1] [2] and the wikipedia page about JPEG.

[edit] GIF

GIF is a lossless, 8-bit color format (maximum of 256 colors) and should be used mainly for animated images on Wikimedia Commons. PNG is almost always superior for still images (see the exception of clickable image maps discussed in the previous section). For animated images GIF uses lossless compression of images up to 256 colors per frame. (There exists an uncommon hack to render higher-color still images as GIF animations,[3] but PNG produces smaller results.)

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.

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. For tools and help see Commons:Chart and graph resources. SVG is especially useful for graphics with text or labels.

[edit] PNG

PNG and SVG are better for drawings / diagrams (SVG is preferred when creating diagrams etc, PNG is good for scanned images, or for print-quality photographs).

PNG is a "lossless" format, meaning that the exact pixel color is preserved when saving, and can be used for any kind of diagram that is not available in SVG format.

[edit] SVG

See also Wikipedia:Graphic Lab/Resources/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.


[edit] TIFF

TIFF files cannot, at this time, be displayed within Wikipedia or on Commons, nor are they 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 megabyte TIFF reduced to 17 megabytes when saved as a PNG.

Overall, PNG should be preferred; however, TIFF 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.

[edit] Sound

See also: Commons:Free media resources/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.

[edit] MIDI

MIDI files are accepted, but not very well supported.

[edit] 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.

[edit] Ogg Vorbis (audio)

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

[edit] Video

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

[edit] 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.)

[edit] Scanned text documents

Use DjVU. See Commons:DjVu.

See also Help:Scanning for advice on scanning non-text items.

[edit] See also

[edit] Tutorials for related topics

[edit] External links