I would like to see Wikipedia provide a template for presenting a pair of images, overlaid. Bitmaps and vector files (SVGs) each have advantages; such a template would allow the two sets of advantages to be combined, by displaying an SVG with a transparent background, overlaid on a bitmap.
Below is my first shot at writing the specification for such a template.
Input parameters
edit- Descriptor of the foreground image.
- Descriptor of the background image.
- x_shift
- y_shift
- positioning: left, right, etc.
- caption
- alt text
- "upright"
- "frame"
- etc.
A "descriptor" is what we might normally use to specify a stand-alone image, something like [[File:T albidum01.jpg|100px]] or {{CSS image crop |Image = T albidum01.jpg|bSize = 167|cWidth = 100|cHeight = 100|oTop = 40|oLeft = 36|100px}}. It must specify the source of the image. It may specify the dimensions of the image, and any cropping information. It should not specify positioning, caption, alt text, etc., as these will be specified as further parameters governing the combined images.
The "foreground" image should be partly transparent, if the template is to achieve anything useful.
"x_shift" and "y_shift" specify the displacement of the foreground image relative to the background image. Each defaults to 0. Each may be negative.
Positioning, caption, etc. are applied to the combined pair of images as they would for a single image.
Output
editThe two images are created as specified by their descriptors, taking account of sizing and cropping information.
They are displayed overlaid, with the foreground image "higher" in the z direction, and their top left corners coincident unless specified otherwise by x_shift and y_shift.
Positioning, alt text, caption, etc. are applied to the combined pair of images as they would be to an ordinary image.
Applications
editThe main use I envisage for such a template is for maps. The topography (coasts, rivers, mountains, roads and railways) would be in the background image, generally as a bitmap for ease of maintenance. The names of countries, regions, cities etc. would be in the foreground image as an SVG with transparent background, again for ease of maintenance, and of translation.
Problems
editWhen a reader clicks on an image in Wikipedia, they can find their way to the copyright information. I believe this is a legal requirement. With two overlaid images, we must arrange that they can find their way to copyright information for both components.
Note
editIt is possible to achieve the same effect with a single SVG image, by including a link to a "background" bitmap. It is not possible to upload such an SVG to Wikipedia, for security reasons.