Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Syntax  





2 Parameters  





3 Internationalisation  





4 Pitfall  





5 Examples  



5.1  Adding explanatory notes  





5.2  Cropping  







6 Subpages (templates based on this template)  





7 See also  














Template:Annotated image






Afrikaans
العربية
Авар

Башҡортса
Беларуская

Català
Cymraeg
Dansk
Deutsch
Ελληνικά
فارسی
Føroyskt
Français
Galego

Հայերեն
ि
Interlingua
Italiano
Latviešu
Lietuvių
Македонски
Bahasa Melayu
Монгол

Nederlands

Norsk nynorsk
Occitan
ି

Papiamentu
Português
Română
Русский

سنڌي
Slovenščina
Српски / srpski
Srpskohrvatski / српскохрватски
Svenska
ி
Taqbaylit
Татарча / tatarça
 


Тоҷикӣ
Türkçe
Українська
Tiếng Vit



 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
Meta-Wiki
Wikisource
Wikiversity
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


Other uses include cropping an image to exclude unimportant parts and perhaps enlarge important parts, and internationalisation, as the annotations can be changed without changing the image.

This template and {{annotated image 4}} are the only two annotated image templates that utilize {{annotation}} to superimpose wikitext onto images.

Syntax

{{Annotated image
| image = 
| image-width = 
| image-left = 
| image-top = 
| width = 
| height = 
| float = 
| annotations = 
{{Annotation | left (in px)| top (in px) | text | text-align=left | font-size=12 | font-weight=bold | font-family=Times New Roman | background-color=#ffcccee | color=blue}}
| caption = 
}}

Parameters

All parameters have names; there are no nameless "numbered" parameters.

Two of the parameters, image and imagemap, are mutually exclusive: use one of them, not both.

In the following list, those parameters required by the template are shown in bold.

Parameter  Allowed values  Default value  Function and notes 
caption wikitext Caption accompanying image.
alt text empty Alt text for people whose vision of the image is impaired (see WP:ALT).
Either  image
or  imagemap
valid image filenamea or
valid X/HTML imagemap
Specify either imageorimagemap, but not both.
width positive integer Total width (in pixels) of the box containing the image and annotations. Must be at least as large as the image's displayed width (which can be set using image-width).
height positive integer Total height (in pixels) of the box containing the image and annotations. Must be at least as large as the image's displayed height. If the displayed width of the image is changed by specifying image-width, the image's displayed height and any additional "margins" for annotations will need to be calculated.
image-left integer (zero) X-coordinate of the image's top left corner (in pixels), relative to the top left corner of the box containing the image and annotations. Negative values crop the image.
image-top integer (zero) Y-coordinate of the image's top left corner (in pixels), relative to the top left corner of the box containing the image and annotations. Negative values crop the image.
image-width positive integer Width of the original image (in pixels). (Look on the file's page and use the second number in the image size.)
annotations Annotations for the image. May be left empty (i.e. |... |annotations= |...) to crop an image only.
link To set the link of image. May be left empty (i.e. |... |link= |...) for purely decorative images.
float
  • right
  • left
  • center
  • none
  • right To specify whether or not the template floats to the right or left of adjacent content.
    outer-css any valid CSS Additional CSS applied to the outermost box. Does not override any other parameters specified for the outer box (i.e. best used only as "a last resort").
    image-bg-color any valid CSS color white Background of the box in which the image is displayed. For example, a dark background for a relatively dark image on which relatively lightly colored annotations are placed.
    image-css any valid CSS Additional CSS applied to the (inner box carrying the) image. Does not override any other parameters specified for this box (i.e. best used only as "a last resort").
    annot-text-align
    • left
  • right
  • center
  • left Sets a default text-alignment for all the contained annotations. Can be overridden per annotation.
    annot-background-color any valid CSS color transparent Sets a default background-color for all the contained annotations. Can be overridden per annotation.
    annot-font-family any valid CSS font-family Sets a default font-family for all the contained annotations. Can be overridden per annotation.
    annot-font-size positive integer Sets a default font-size (in pixels) for all the contained annotations. Can be overridden per annotation.
    annot-font-weight any valid CSS font-weight Sets a default font-weight for all the contained annotations. Can be overridden per annotation.
    annot-font-style any valid CSS font-style Sets a default font-style (e.g. "italic") for all the contained annotations. Can be overridden per annotation.
    annot-line-height any valid CSS line-height Sets a default line-height (line spacing) for all the contained annotations. Can be overridden per annotation.
    annot-color any valid CSS color Sets a default color for all the contained annotations. Can be overridden per annotation.
    a SVG images allowed.

    Internationalisation

    This template makes internationalisation easy; the text is already separate from the image, so it is easy to translate the text and, if necessary, move pieces of text, as the lengths of the same text in different languages can vary a lot. For example, nl:Sjabloon:Zijbalk mariene extincties, the Dutch version of Template:Annotated image/Extinction, is widely used.

    Pitfall

    There is one pitfall, although it is mainly about using one browser in the correct way (Microsoft Internet Explorer, of course). Internet Explorer has two ways of scaling up text to ease readability:

    Examples

    Template:Annotated image/Extinction

    Adding explanatory notes

    See Template:Annotated image/doc/Samples.

    Cropping

    You have an image like commons:File:Mona Lisa color restoration2.jpg. But you want to show only a part of the image, say a part of the nose and mouth:

    This image has a factual width of 300 pixels (as stored in commons), but this is irrelevant by the use of the template.
    All measures related to image-width, the virtual width you have given to the image (in the example: 2000px)

    You can do it with following code:

    {{Annotated image
    | image = Mona Lisa color restoration2.jpg
    | image-width = 2000  <!-- choose any width, as you like it. It doesn't matter the factual width of the image-->
    | image-left = -850   <!-- crop the left part. Be aware of the "-" minus symbol  --> 
    | image-top = -800    <!-- crop the upper part. Be aware of the "-" minus symbol  -->
    | width =  250        <!-- crop the right part. That will be the width of the image in the article -->
    | height =  250       <!-- crop the below part. That will be the height of the image in the article -->
    | float = left
    | annotations =       <!-- empty or not, this parameter must be included -->
    | caption = Cropped Mona Lisa from a 2000 pixel image
    }}
    

    The result is a 250pixels x 250pixels area from the 2000 pixels width image (the factual width of the image doesn't matter). The upper 800 pixels and the 850 pixels at the left side of the 2000-image are "discarded" as well as the "rest" at the right side after the 250 pixels and at the bottom after the 250 pixels:

    Cropped Mona Lisa from a 2000 pixel image

    Subpages (templates based on this template)

    This list is automatically generated and updated. Redirects are shown in italics.

  • Annotated image/Arthropod head problem/doc
  • Annotated image/Extinction
  • Annotated image/Extinction/doc
  • Annotated image/Himachal Pradesh
  • Annotated image/Porifera cell types
  • Annotated image/Porifera cell types/doc
  • Annotated image/Skeletal anatomy of T rex right leg
  • Annotated image/Skeletal anatomy of T rex right leg/doc
  • Annotated image/Snail radula working
  • Annotated image/Snail radula working/doc
  • Annotated image/Trochophore larva
  • Annotated image/Trochophore larva/doc
  • Annotated image/doc
  • Annotated image/doc/Samples
  • Annotated image/sandbox
  • Annotated image/testcases
  • See also


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Annotated_image&oldid=1187979506"

    Category: 
    Annotated image templates
    Hidden category: 
    Wikipedia semi-protected templates
     



    This page was last edited on 2 December 2023, at 17:41 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki