There are a number of reasons to use images in the questionnaire: as the stimulus in the survey, the university or company logo on each page, a logo, or the scanned signature welcoming the participant to the questionnaire.
This chapter explains how to optimize images for online display, and how to subsequently insert them into the questionnaire. First of all, a word of warning in advance.
As a rule, photos, as well as graphics (e.g. section of a map) are subject to copyright. If there are people in the picture, then this is also subject to privacy rights.
If you use an image taken from the internet or the image of a person, you face – alongside claims for damages – horrendous lawyers' fees. For more information, please look up the term “cease-and-desist” on the internet.
Therefore, you always need written consent from the author to use the image (right of use). Furthermore, written consent is required from the people in the picture. Free image databases are an exception to this rule – however, some other restrictions may apply (e.g. that the author has to be specified).
Images are stored on the internet as standalone files that can be downloaded from a web address (URL). There are two stages to using images in the questionnaire:
If an image is embedded using HTML code, the position of the image can be adjusted more precisely. The HTML code displays the image image.jpg
in the center and leaves a spacing of 40 pixels above/below for other content.
<div style="text-align: center; margin: 40px 0"> <img src="image.jpg" alt="Image of a Woman"> </div>
The following HTML code displays an image aligned to the right and enables text to flow to the left of it with a spacing of 20 pixels. This could be used, for example, for the question title.
<img src="image.jpg" alt="Image of a Woman" style="float: right; margin-left: 10px">
Please look closely at the image on the right.
Afterwards, please evaluate the image in light of the statements that can be read below.
You can also fall back on the predefined CSS classes “left” and “right” for floating text.
<img src="image.jpg" alt="Image of a Woman" class="right">
Please look closely at the image on the right.
Note: Theoretically, you could also use images that stored on a different web server in the questionnaire with HTML code . However, the legal problems regarding the usage still remain – and the image should be downloaded via encrypted HTTPS protocol, if the questionnaire is also transmitted in encrypted format. Otherwise, some internet browsers display a security warning.
Tip: If you want to display an image as a logo on each page in the questionnaire, do not upload it in the normal way. Instead, upload it in Footer and Logo in the tab Logo.
A few preparations are necessary to ensure an image can be displayed properly. Generally, the image has to be scaled to the right size and then saved in a file format suitable for the internet (e.g. GIF, PNG or JPG).
Image editing software is needed to process images for the internet. If you do not have this type of software to hand, download the open source software GIMP for free.
The size of the image displayed in the questionnaire depends on the size of the pixel. One pixel (typically) corresponds to one pixel on the screen. Set the magnification/zoom in your image editing software to 100% in order to see the original size of the image.
Scale the image as follows:
<img src="..." style="max-width: 100%">
to automatically resize an image as well.Colour depth describes how many colors a single pixel can have in the image. The average screen can display around 16 million different colors (24-bit - 8-bit each and 256 shades of the primary colors red, green, and blue ). Only a fraction of these are needed for graphics (e.g. graphs, website screenshots, schematic diagrams): a black and white image (line drawing) only needs 2 colors, a greyscale images only needs 8-bit (265 shades of gray) or less. Even a colorful diagram can get by with few colors if needs be. On the other hand, photos usually require full color depth.
The color depth depends greatly on the file format used:
Images and Graphics Examples (each 100 × 100 pixels)
Photo (JPG) 85% Quality | Photo (JPG) 15% Quality | Reduced to 8 Colors (PNG) | Graphic (PNG) 8 Colors | Graphic (PNG) 8 Colors |
The widely used plug-in “uBlock Origin” identifies certain file names as advertisements. Avoid file names that start with an “AD” (for example, “AD1_new.jpeg”). Test your questionnaire in different browsers and with active ad blockers.
In the menu item Image and Media Files, you can upload an image into your project overview. Select the tab Upload images in order to do so.
pro://
as a prefix. The are several ways to integrate an image:
Only the <img>
HTML tag is needed to insert an image with HTML. The image address (source, “src”) must be given as the attribute. In addition to this, alternative text (alt
) which is shown if the images cannot be displayed for whatever reason, should be specified. In order to make the questionnaire accessible, another description of the image content can be added by using title
.
If an image has been uploaded in the project view, the address (src
) is simply the file name of the image. The paragraph tag in the following example ensures that the image appears in its own section, and not in the middle of the text.
<p>Text above the image.</p> <p><img src="image.gif" alt="Pink Elephant"></p> <p>Text below the image.</p>
There are two CSS classes (class
) defined in SoSci Survey, with which you can position an image so that the text runs around the outside: left
and right
. Thus, if an image should appear to the right of the text, the class right
will be added to the <img> tag as the attribute:
<h1>Welcome</h1> <p><img src="https://www.soscisurvey.de/homepage/sosci.logo.png" alt="SoSci Survey" class="right"> This example demonstrates how an image can be positioned to the right of the text.</p>
HTML permits a variety of options when inserting images – for more information please see SelfHTML: Graphics and SelfHTML: CSS Properties.
Images can also be integrated directly into questions and items. The HTML tag <img>
is used here once again.
This means the verbal anchorage in a scale with intermediate values can be graphically designed, or be selected in a Horizonal selection between images.
Tip: You do not have to write the <img>
tag yourself. Open Image and Media Files and click on the desired image. The HTML code appears immediately.
Note: The following examples use a specific notation as the image address: ofb://imagename
. These means some default images available in SoSci Survey (e.g. a smiley scale and a thumb scale) can be integrated. If you upload the images yourself, use the file name of the image.
Note: Upper and lowercase are both valid on the internet. Image.gif
is not the same as image.gif
. If an image cannot be displayed, check the case and the ending first of all. Avoid blank spaces in file names.