Images: Difference between revisions

From MoodleDocs
mNo edit summary
m (updated video to 4.3)
 
(22 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Working with media}}
{{Working with media}}
Moodle allows teachers and students to upload and display images from a variety of sources via the image icon of the [[HTML editor|text editor.]]Course pages can be enhanced with images (or banners) in each section. Assignments can include images for extra clarification. Images attached to forum posts or quiz questions will appear embedded.  
Moodle allows teachers and students to upload and display images from a variety of sources via the image icon of the [[Text editor]]. Course pages can be enhanced with images (or banners) in each section. Assignments can include images for extra clarification. Images attached to forum posts or quiz questions will appear embedded.  
 
{{MediaPlayer | url = https://youtu.be/Dw28f6XpIl4 | desc = Adding images}}
{{MediaPlayer | url = https://youtu.be/rehPpxl2Jh4 | desc = Adding images}}
Moodle accepts .jpg,.png,.svg and .gif formats.
Moodle accepts .jpg,.png,.svg and .gif formats.
 
==Dragging and dropping an image==
*Images may be dragged and dropped directly into the [[Atto editor]] if you are using a supported browser (not IE 9, Safari 6 or below or earlier versions of Firefox) and can be dragged and dropped directly onto the course page if the editing is turned on and 'media drag and drop" is enabled in ''Administration > Site administration > Plugins > Activity modules > Label''.
* See [[Using Label]] for more information.
==Copying and pasting an image==
In Moodle 3.9 onwards, images can be copied from anywhere and pasted into the [[Atto editor]]. For example, you can copy and paste an image from a word-processed document or take a screenshot, copy it to your clipboard and then paste it into the Atto editor.
==Uploading and displaying an image from your computer==
==Uploading and displaying an image from your computer==
*''Note:'' It is a good idea to resize your image before uploading, rather than altering its dimensions online.
*''Note:'' It is a good idea to resize your image before uploading, rather than altering its dimensions online.
*With the editing turned on, access the [[HTML editor|text editor]] where you want to display your image (eg, in a course summary,label or page)
*With the editing turned on, go to where you want to display your image (e.g. in a course summary, label or page)
*Click the image icon as below
*Click the image icon as below
 
[[File:ImageIcon310.png]]
[[File:Imageicon.png]]
 
*Either enter the URL of an image which is already online or click 'Browse repositories' to access the File picker
*Either enter the URL of an image which is already online or click 'Browse repositories' to access the File picker
[[File:uploadimageatto.png]]
*Click [[Upload a file]]. Browse for and upload your image. For more information, see [[File picker]]  
*Click [[Upload a file]]. Browse for and upload your image. For more information, see [[File picker]]  
*Either add a description of the image or tick/check the box 'Description not necessary'.
*Either add a description of the image or tick/check the box 'This image is decorative only'.
*Alter the size and alignment if needed and save the image
*Alter the size and alignment if needed and save the image
 
[[File:ImageUpload310.png]]
[[File:uploadedimageatto.png]]
==Editing an uploaded image==
 
If you need to edit the image once it has been uploaded,you can double-click on the image from within the [[Text editor|text editor]] and access the image properties window. ''Note it is much better to upload an image of the desired size rather than modifying it afterwards.''
===Editing an uploaded image===
 
*If you need to edit the image once it has been uploaded,you can double-click on the image from within the [[Text editor| Atto text editor]] and access the image properties window. ''Note it is much better to upload an image of the desired size rather than modifying it afterwards.''
 
==Dragging and dropping an image==
 
*Images may be dragged and dropped directly into a label onto the course page if you are using a supported browser (not IE 9, Safari 6 or below or earlier versions of Firefox) and  'media drag and  drop" is enabled in ''Administration > Site administration > Plugins > Activity modules > Label'' and verify the box 'media drag and drop' setting is ticked.
*As you drag the image, a prompt box appears where you choose "add image to course page" rather than "create a file resource"
*See [[Using Label]] for full instructions  how to do this.
 
==Displaying an image already online==
==Displaying an image already online==
*If you have images available elsewhere online, you can display them too without the need to upload to Moodle. ''Note:'' If the image is taken offline, it will be replaced by a red X on your course page. Also, so-calledhot-linking [http://simple.wikipedia.org/wiki/Hot-linking]to images online if you don't own them yourself is not recommended.
If you have images available elsewhere online, you can display them too without the need to upload to Moodle by entering their online address in the Enter URL field. ''Note:'' If the image is taken offline, it will be replaced by a red X on your course page. Linking [http://simple.wikipedia.org/wiki/Hot-linking] to images online if you don't own them yourself is not recommended.
===Method 1===
[[de:Bilder]]
*Follow the instructions for Uploading and Displaying an image as above.
[[es:Imágenes]]
*Paste the URL of the image you have online into the ''Enter URL'' box.
[[fr:Images]]
*Add a description of the image or tick/check the box for no description
==Scale an image==
If images are uploaded and embedded into a page or question, these are "responsive" automatically. This means that if the image doesn't fit into the space available on the page, it is automatically downscaled. If the page contains more space than the image would actually require, then it is displayed in it's maximum size but not upscaled.
===Suitable images for scaling===
If images are scaled on a webpage naturally this leads to losses of the image quality. Image information either needs to be compressed when scaling down, or needs to be interpolated when upscaling is done. In both cases this may work well on ome image and not so good on others. Before uploading an image you may check this by opening the image in your browser and manually change the view, increase the percentage or lower it and check the result that is being displayed by the browser.


[[File:imageonlineatto.png]]
Images that usually scale well are charts or images with a lot of lines. Small letters or symbols however, may not be well recognizable anymore because they are too small to read or contain too many artefacts when enlarged. Photographs usually do not look bad when they get downscaled. However, upscaling usually blurs them or reveal visible pixels.
*Save the image.


===Method 2===
An exception are files of the type SVG. These files are so called vector graphics. The image doesn't store any pixels but definitions on how to draw geometric shapes. Depending on the scale these figures are
*It is possible to copy and paste an online image into the [[HTML|text editor]] in the same way that some students might copy and paste into a presentation. Care must be taken however that images pasted this way are not subject to copyright, and also that the image doesn't come with an unwanted hyperlink.
smaller or larger but drawn from scratch. Also letters and that kind still look good.


==Adding an image from image hosting sites like Flickr==
===Upscaling of images===
*It is possible to search and display an image from Flickr.
*For this, the [[Flickr public repository]] must be enabled by the administrator
*After clicking into Find or Upload an image, click on the Flickr repository to search for a suitable image.


[[File:Flickr.png]]
Sometimes it is desired that an image takes the whole width of the page even though the actual image is smaller. Then upscaling is needed. The image will be displayed in a larger size than it actually is. This does work automatically but must be adapted when inserting an image in the text.


*The site administrator can also enable the [[Flickr repository|Flickr]] and [[Picasa web album repository|Picasa]] repositories for users to access images from their own accounts.
[[File:Image scaling.png|alt=Atto editor editing text|thumb|none|Atto editor: change the img tag in the in source mode]]
[[File:tiny_en_scaling_img1.png|alt=TinyMCE editor change to source code view|thumb|none|TinyMCE editor: switch to source code view]]
[[File:tiny_en_scaling_img2.png|alt=TinyMCE editor editing img tag in source mode|thumb|none|TinyMCE editor: change the img tag in the in source mode]]


==Why is there no 'Browse repositories' option available?==
After inserting the image, the editors view must be changed into the source view (1). In the HTML the <img> tag must be searched (2). At the end of that <img> element there are two attributes, width and height (3). The value of the width attribute must be set to "100%", the height attribute can be removed entirely. After that, the editor can be switched back to WYSIWYG mode or the page/question can be saved.
 
Note that whenever the image is reedited with the editor using the toolbar button and the dialogue, then the attributes are set back to the image size. Therefore, avoid reediting images with the editor or reapply the attribute changes.
The filepicker and text editor in Moodle are affected if there are any Javascript errors in the page. So if you see any missing buttons etc. the first thing to check for is any errors in the Javascript console (F12 in Firefox or IE9+).
 
The second thing to mention is that some text areas in Moodle support uploading files and some do not. There are reasons why a particular area does or doesn't support files such as the ability to backup/restore or compatibility with other areas in Moodle such as the gradebook. If a text editor does not support file areas, you can still use images, but only by entering the URL to an image already hosted somewhere else on the internet.  
 
[[de:Bilder]]
[[es:Imágenes]]
[[fr:Images]]

Latest revision as of 14:03, 15 November 2023

Moodle allows teachers and students to upload and display images from a variety of sources via the image icon of the Text editor. Course pages can be enhanced with images (or banners) in each section. Assignments can include images for extra clarification. Images attached to forum posts or quiz questions will appear embedded.

Adding images

Moodle accepts .jpg,.png,.svg and .gif formats.

Dragging and dropping an image

  • Images may be dragged and dropped directly into the Atto editor if you are using a supported browser (not IE 9, Safari 6 or below or earlier versions of Firefox) and can be dragged and dropped directly onto the course page if the editing is turned on and 'media drag and drop" is enabled in Administration > Site administration > Plugins > Activity modules > Label.
  • See Using Label for more information.

Copying and pasting an image

In Moodle 3.9 onwards, images can be copied from anywhere and pasted into the Atto editor. For example, you can copy and paste an image from a word-processed document or take a screenshot, copy it to your clipboard and then paste it into the Atto editor.

Uploading and displaying an image from your computer

  • Note: It is a good idea to resize your image before uploading, rather than altering its dimensions online.
  • With the editing turned on, go to where you want to display your image (e.g. in a course summary, label or page)
  • Click the image icon as below

ImageIcon310.png

  • Either enter the URL of an image which is already online or click 'Browse repositories' to access the File picker
  • Click Upload a file. Browse for and upload your image. For more information, see File picker
  • Either add a description of the image or tick/check the box 'This image is decorative only'.
  • Alter the size and alignment if needed and save the image

ImageUpload310.png

Editing an uploaded image

If you need to edit the image once it has been uploaded,you can double-click on the image from within the text editor and access the image properties window. Note it is much better to upload an image of the desired size rather than modifying it afterwards.

Displaying an image already online

If you have images available elsewhere online, you can display them too without the need to upload to Moodle by entering their online address in the Enter URL field. Note: If the image is taken offline, it will be replaced by a red X on your course page. Linking [1] to images online if you don't own them yourself is not recommended.

Scale an image

If images are uploaded and embedded into a page or question, these are "responsive" automatically. This means that if the image doesn't fit into the space available on the page, it is automatically downscaled. If the page contains more space than the image would actually require, then it is displayed in it's maximum size but not upscaled.

Suitable images for scaling

If images are scaled on a webpage naturally this leads to losses of the image quality. Image information either needs to be compressed when scaling down, or needs to be interpolated when upscaling is done. In both cases this may work well on ome image and not so good on others. Before uploading an image you may check this by opening the image in your browser and manually change the view, increase the percentage or lower it and check the result that is being displayed by the browser.

Images that usually scale well are charts or images with a lot of lines. Small letters or symbols however, may not be well recognizable anymore because they are too small to read or contain too many artefacts when enlarged. Photographs usually do not look bad when they get downscaled. However, upscaling usually blurs them or reveal visible pixels.

An exception are files of the type SVG. These files are so called vector graphics. The image doesn't store any pixels but definitions on how to draw geometric shapes. Depending on the scale these figures are smaller or larger but drawn from scratch. Also letters and that kind still look good.

Upscaling of images

Sometimes it is desired that an image takes the whole width of the page even though the actual image is smaller. Then upscaling is needed. The image will be displayed in a larger size than it actually is. This does work automatically but must be adapted when inserting an image in the text.

Atto editor editing text
Atto editor: change the img tag in the in source mode
TinyMCE editor change to source code view
TinyMCE editor: switch to source code view
TinyMCE editor editing img tag in source mode
TinyMCE editor: change the img tag in the in source mode

After inserting the image, the editors view must be changed into the source view (1). In the HTML the <img> tag must be searched (2). At the end of that <img> element there are two attributes, width and height (3). The value of the width attribute must be set to "100%", the height attribute can be removed entirely. After that, the editor can be switched back to WYSIWYG mode or the page/question can be saved. Note that whenever the image is reedited with the editor using the toolbar button and the dialogue, then the attributes are set back to the image size. Therefore, avoid reediting images with the editor or reapply the attribute changes.