KGCOE-Research

Image Examples


This article assumes that there is an image that has been uploaded to the same directory as this node named Wiki.png. Linking to that image can happen with a normal node-link like this, but it is nice to display the images within the node text itself. The following examples are ways to display that image.

The image syntax is, in general, the same as the standard MediaWiki image format with some quirks.

Image options are separated in the link by pipe (|) characters. The supported options are: 

  • Alignment:
    • left
    • center
    • right
    • none default
  • frame for showing caption
  • Npx for scaling, default value of 150px
  • Arbitrary text captions, defaults to the image name

Without Framing

The simplest example, put an image on the page inline with the text:

[[image:Wiki.png]]

Here is the working example in this line of text.

The image can be floated left or right by adding the options left or right as these examples show. Notice that the image is always top-aligned with the line containing the image tag itself. 

Text in following paragraphs flows around these images. Which allows the image to be placed in the document where it is needed for context, but doesn't disturb the flow of text. Floating right is the preferred method of displaying an image, it avoids crowding the text and allows for easier reading.

When an image is centered with the center option, it occupies the entire vertical space of the page, as in the following example: 

This should be avoided because it breaks the flow of the text. Centered images should be rather important and should be placed between paragraphs, not within them.

Resizing the image is as simple as adding a pixel-size option to the link. If the given pixel size is larger than the actual image, it will not be expanded, but left the original size. Here is the image at width of 100 pixels: , and here is one with a 50 pixel width: . Resized images should be cached by the server, so the processing overhead should be minimal.

With Frames

To make the embedded images look better, the frame option can be applied to any of the above image examples. One thing to note is that a width property should always be given with the frame option so that the frame "hugs" the image on the sides. The width supplied actually sets the width of the frame, so it is good to have it be the same as the image itself.

Here is a simple framed example:

[[image:Wiki.png|frame|right|135px]]

If the image should be displayed at full resolution, simply give a width option that is the width of the image. This will not resize the image, but will make the frame look better.

The image displayed on the right has a default caption of "Wiki.png" because no caption was given, to add a caption simply put text in the link that does not match one of the other options.

Here is a simple example:

[[image:Wiki.png|frame|right|135px|Caption text here]]
 
Caption text here
Caption text here

Notice that the images will not crowd the text horizontally, but will "hug" the side of the page, which may extend the page vertically. In this case, it is better to put the image link above where the text mentions it so that it will be within the text that is below the link.

Finally, below is shown a centered example using the link: 

[[image:Wiki.png|frame|center|200px|This takes a lot of space, but may look better for very large images]]

This takes a lot of space, but may look better for very large images
This takes a lot of space, but may look better for very large images