Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
graphics [2018/10/26 11:39]
qcbs [Exercize 5 - Using the svglite package.]
graphics [2021/03/29 11:24]
qcbs [GIMP]
Line 3: Line 3:
 Offered by Guillaume Larocque, Quebec Centre for Biodiversity Science. ​ Offered by Guillaume Larocque, Quebec Centre for Biodiversity Science. ​
  
-October ​30, 2018McGill University+March 29-30, 2021Online
  
 [[https://​prezi.com/​view/​P9qA6oN11cCAwjay2Hml/​|Link to Prezi presentation.]] [[https://​prezi.com/​view/​P9qA6oN11cCAwjay2Hml/​|Link to Prezi presentation.]]
 ===== GIMP ===== ===== GIMP =====
 +
 +{{::​1200px-the_gimp_icon_-_gnome.svg.png?​200|}}
  
 To install GIMP, go to [[https://​www.gimp.org/​downloads/​|this site]] and follow instructions. ​ To install GIMP, go to [[https://​www.gimp.org/​downloads/​|this site]] and follow instructions. ​
Line 12: Line 14:
 To put GIMP in single window mode, click on Window>​Single Window Mode, and restart GIMP.  To put GIMP in single window mode, click on Window>​Single Window Mode, and restart GIMP. 
  
 +To put the Toolbox icons in color, go to Edit>​Preferences>​Interface>​Icon Theme> and choose Color. ​
  
 ==== Exercise 1 - Basic image cropping, rotation and resizing. ==== ==== Exercise 1 - Basic image cropping, rotation and resizing. ====
Line 19: Line 22:
   - Open it in GIMP using File>​Open.   - Open it in GIMP using File>​Open.
   - From the tools, click on the Rotate icon {{::​screenshot_from_2017-10-17_15-30-02.png?​nolink|}} and rotate the image so to make the road at the back approximately horizontal. ​   - From the tools, click on the Rotate icon {{::​screenshot_from_2017-10-17_15-30-02.png?​nolink|}} and rotate the image so to make the road at the back approximately horizontal. ​
-  - Use the "Rectangle Select" {{::rectangle_select_tool.png?​nolink|}} ​tool to keep only the part of the image that contains the main protagonists. +  - Use the "Crop tool" {{::auto_crop_tool.png?​nolink|}} to keep only the part of the image that contains the main protagonists. ​Press ENTER to validate the selection
-  - Click on Image>"​Crop ​to selection" to remove the non-selected portion of the image.  ​+
   - Use the Colors>​Curve interface to make the dark areas of the image a bit darker, while making the other shades of the image untouched. Your curve should look like this: {{:​screenshot_from_2017-10-17_16-18-51.png?​direct&​200|}}   - Use the Colors>​Curve interface to make the dark areas of the image a bit darker, while making the other shades of the image untouched. Your curve should look like this: {{:​screenshot_from_2017-10-17_16-18-51.png?​direct&​200|}}
   - Use the Clone tool {{::​clone_tool.png?​nolink|}} and the Healing tool {{::​healing_tool.png?​nolink|}} to remove small specks in the image. After clicking on the tool's icon, click on a reference area close to the speck you want to remove, and then click CTRL and click on the speck. Make sure that the brush size is appropriate. You can play with the opacity of a brush for a more subtle effect. ​   - Use the Clone tool {{::​clone_tool.png?​nolink|}} and the Healing tool {{::​healing_tool.png?​nolink|}} to remove small specks in the image. After clicking on the tool's icon, click on a reference area close to the speck you want to remove, and then click CTRL and click on the speck. Make sure that the brush size is appropriate. You can play with the opacity of a brush for a more subtle effect. ​
   - Use Image>"​Scale image" and the "​Crop"​ tool {{::​auto_crop_tool.png?​nolink|}} with a fixed size to obtain an image that is exactly 120dpi (pixels per inch) at 8.5x11 inches. Use the Image>​Print size to verify that it works. ​   - Use Image>"​Scale image" and the "​Crop"​ tool {{::​auto_crop_tool.png?​nolink|}} with a fixed size to obtain an image that is exactly 120dpi (pixels per inch) at 8.5x11 inches. Use the Image>​Print size to verify that it works. ​
 +EXTRA: ​
 +  - Convert the image to RGB by selecting Image>​Mode>​RGB. ​
 +  - You can try to colorize the hats on the picture by selecting them with the Free select tool, choosing a foreground color on the left, and using the bucket tool to click on the selected region. You will have to adjust the the threshold of the bucket to fill the whole region and the opacity so that we can see through the color making it look more realistic. ​
 +  - You can also give the image a sepia tone by choosing Color Balance, and moving the sliders towards the yellow and the red. 
  
 ==== Exercise 2 - Layers, cropping and manipulation of colors. ==== ==== Exercise 2 - Layers, cropping and manipulation of colors. ====
Line 30: Line 36:
  
   - Download this [[https://​unsplash.com/​photos/​9Z1KRIfpBTM|image of a leaf]] and open it in GIMP.    - Download this [[https://​unsplash.com/​photos/​9Z1KRIfpBTM|image of a leaf]] and open it in GIMP. 
-  - Go to [[https://​unsplash.com|unsplash]] and download the photo of an animal of your choice. We will try to put that animal on the leaf. So choose something that works, but is original! ​+  - Go to [[https://​unsplash.com|unsplash]] and download the photo of an animal of your choice ​(or any photo with a subject of your choice). We will try to put that animal on the leaf. So choose something that works, but is original! ​
   - Open the image you downloaded in GIMP. Use the Free select tool {{::​free_select_tool.png?​nolink|}} to delineate carefully the outline of the animal you wish to extract. At this point, you can just delineate the outside.   - Open the image you downloaded in GIMP. Use the Free select tool {{::​free_select_tool.png?​nolink|}} to delineate carefully the outline of the animal you wish to extract. At this point, you can just delineate the outside.
-  - Click on Copy (CTRL-C) and then go to the GIMP page with the leaf and click on Edit>​Paste as>New layer. In the list of layers, double-click on the layer name (Should be "​clipboard"​) and change it to the name of your animal. ​+  - Click on Copy (CTRL-C) and then go to the GIMP page with the leaf and click on Edit>​Paste as>New layer in place. In the list of layers, double-click on the layer name (Should be "​clipboard"​) and change it to the name of your animal. ​
   - Using the Scale tool {{::​scale_tool.png?​nolink|}},​ resize the layer and re-position over the leaf with the Move tool.    - Using the Scale tool {{::​scale_tool.png?​nolink|}},​ resize the layer and re-position over the leaf with the Move tool. 
-  - If there are parts of the animal that you would like to crop out (e.g. space between the legs), delineate it with the Free select tool and press DELETE to remove it. +  - If there are parts of the animal that you would like to crop out (e.g. space between the legs), delineate it with the Free select tool and press DELETE to remove it. You can also use the eraser tool for that
   - Click on the layer in the layer menu and then open Colors>"​Brightness,​ Contrast"​ to adjust the image so that it looks realistic on the leaf. Do the same with Colors>"​Hue,​ saturation"​. ​   - Click on the layer in the layer menu and then open Colors>"​Brightness,​ Contrast"​ to adjust the image so that it looks realistic on the leaf. Do the same with Colors>"​Hue,​ saturation"​. ​
   - Right-click on the layer that contains the leaf in the layer menu and choose Add Alpha Channel. This will allow the layer to contain transparent parts. ​   - Right-click on the layer that contains the leaf in the layer menu and choose Add Alpha Channel. This will allow the layer to contain transparent parts. ​
Line 57: Line 63:
   - Repeat the operation with the other duplicate of the image for the top part. Start by applying the Gaussian blur and then add the mask and apply the gradient from the center to the top third of the image. ​   - Repeat the operation with the other duplicate of the image for the top part. Start by applying the Gaussian blur and then add the mask and apply the gradient from the center to the top third of the image. ​
   - Your image should now be blurry on the top and bottom and should have the tilt-shift look. What happens if you now make the mask from step 1 visible? What if you change their order? ​   - Your image should now be blurry on the top and bottom and should have the tilt-shift look. What happens if you now make the mask from step 1 visible? What if you change their order? ​
 +
 +==== Exercise 4 - GIFs! ====
 +
 +You will be making a GIF animation that highlights how cool your research is! 
 +
 +  * Find some photos or graphs from your research that you want to highlight. ​
 +  * In GIMP, click on File>New and select a 640x480 document with a White background. ​
 +  * Open the content you want to put in the animation in GIMP and copy it as new layers using Edit>​Paste as...>​New layer. Resize the content to fit into the page using the Scale Tool. 
 +  * Reorder the layers, knowing that the bottom layer will be played first and the top layer last. 
 +  * Change the name of each layer to designate the associated content. After the name of the layer add (500ms) to get something like: "First photo(500ms)"​. The number in parenthesis is the duration of this slide in the GIF animation. ​
 +  * For slides with text, click on the Text tool and choose the font and font size from the Tool options before adding the text. When you are done placing and resizing the text, add (500ms) to the name of the text layer. ​
 +  * To give a background to your text, first choose a foreground color by clicking on the Foreground and Background Color icon. Then, add an empty layer to the bottom of the text (by clicking the Create a new layer icon {{::​add_layer_icon.png?​nolink|}}) that has that foreground color. When satisfied with both the text and the background, right click on the text layer and choose Merge Down. The text is now fused with the background and you can't remove it. 
 +  * You can test your animation by clicking on Filters>​Animation>​Playback. ​
 +  * When you are happy with your work, choose File>​Export as>GIF Image, and then click on As animation, leaving the other options unmodified. If it asks if you want to crop, click yes. 
 +  * You can now open your animation in a web browser! ​
 +
  
  
 ===== Inkscape ===== ===== Inkscape =====
 +
 +{{::​1200px-inkscape_logo.svg.png?​200|}}
 +
 +
 To install Inkscape, go to [[https://​inkscape.org/​en/​release/​0.92.2/​|this site]] and download the version for your platform. If you are on Mac OSX, carefully read the extra steps needed. ​ To install Inkscape, go to [[https://​inkscape.org/​en/​release/​0.92.2/​|this site]] and download the version for your platform. If you are on Mac OSX, carefully read the extra steps needed. ​
-==== Exercise ​====+==== Exercise ​====
  
  
Line 85: Line 111:
   - Export your logo as a PNG image by clicking on File>​Export PNG image. Click on Export area "​Page"​ and then select a size of 500x500px. ​   - Export your logo as a PNG image by clicking on File>​Export PNG image. Click on Export area "​Page"​ and then select a size of 500x500px. ​
  
-==== Exercize ​- Using the svglite package.====+==== Exercize ​- Using the svglite package.====
 If you are unable to do this exercize, you can download the {{ ::fig1.svg |SVG File here}} If you are unable to do this exercize, you can download the {{ ::fig1.svg |SVG File here}}
  
Line 105: Line 131:
   - If you are curious, your can open this SVG file in Notepad or TextEdit to check the structure of the SVG/XML file. You could modify the file in text form if you wanted. ​   - If you are curious, your can open this SVG file in Notepad or TextEdit to check the structure of the SVG/XML file. You could modify the file in text form if you wanted. ​
   - Note that the text created with svglite has a fixed width (textLength is specified in the xml text tag. So, if you increase the size of the font, it will become higher but not wider. To fix this problem, open the XML Editor (Edit>​XML Editor) and clear the textLength section for text objects. You could also make this change by editing the SVG in a text editor. ​   - Note that the text created with svglite has a fixed width (textLength is specified in the xml text tag. So, if you increase the size of the font, it will become higher but not wider. To fix this problem, open the XML Editor (Edit>​XML Editor) and clear the textLength section for text objects. You could also make this change by editing the SVG in a text editor. ​
-  - Note that you could also save your file in pdf format and open it in Inkscape as a PDF. It will still be a vector file, but it may be easier to use in some cases than the SVG format. <file rsplus>+  - **Note that you could also save your file in pdf format and open it in Inkscape as a PDF. It will still be a vector file, but it may be easier to use in some cases than the SVG format.** <file rsplus>
 pdf("​fig1.pdf"​) pdf("​fig1.pdf"​)
 pie(country_count$Freq,​labels=country_count$Var1) pie(country_count$Freq,​labels=country_count$Var1)
Line 111: Line 137:
 </​file>​ </​file>​
 ==== Exercise 6 - Infographic! ==== ==== Exercise 6 - Infographic! ====
-  - Open the graphic created in step in Inkscape.+  - Open the graphic created in step in Inkscape.
   - Resize the document in File>​Document properties to 240x160mm. ​   - Resize the document in File>​Document properties to 240x160mm. ​
   - Choose a color gradient. To facilitate this task, you can select from the color palette at the bottom of the screen. Next, click on the sectors of the diagram to change the colors and make a gradient from dark for the larger sectors to lighter colors for the smaller sectors. ​   - Choose a color gradient. To facilitate this task, you can select from the color palette at the bottom of the screen. Next, click on the sectors of the diagram to change the colors and make a gradient from dark for the larger sectors to lighter colors for the smaller sectors. ​
Line 120: Line 146:
   - Choose a photo that you want to put at the centre of the diagram on EOL (http://​eol.org) by searching with the name of the species. Save this photo to your computer and import in Inkscape with File>​Import. ​   - Choose a photo that you want to put at the centre of the diagram on EOL (http://​eol.org) by searching with the name of the species. Save this photo to your computer and import in Inkscape with File>​Import. ​
   - Resize approximately the image and click on the Create circles, ellipses and arcs icon. Click-drag on the photo to delineate the part of the photo that you want to put in the circle. You can put the circle semi-transparent (Fill, change Opacity) to make this easier. Then, select the photo and the circle by clicking and holding the SHIFT key. Click on Object>​Clip>​Set. This should crop the photo to a circle. You can release the clip at any time to undo this operation and get the complete photo back.    - Resize approximately the image and click on the Create circles, ellipses and arcs icon. Click-drag on the photo to delineate the part of the photo that you want to put in the circle. You can put the circle semi-transparent (Fill, change Opacity) to make this easier. Then, select the photo and the circle by clicking and holding the SHIFT key. Click on Object>​Clip>​Set. This should crop the photo to a circle. You can release the clip at any time to undo this operation and get the complete photo back. 
-  - Download a silhouette of your animal, or this {{ ::​cougar_silhouette.png?​linkonly |Cougar silhouette}} and open it in Inkscape as a separate file. Click on the silhouette and Path>Vectorize ​bitmap. Choose Colors, specify 2 passes, and click on OK. You can then select the silhouette in vector format by clicking on it and copy-paste it on your infographic. Now, position it and choose a color. ​+  - Download a silhouette of your animal, or this {{ ::​cougar_silhouette.png?​linkonly |Cougar silhouette}} and open it in Inkscape as a separate file. Click on the silhouette and Path>Trace bitmap. Choose Colors, specify 2 passes, and click on OK. You can then select the silhouette in vector format by clicking on it and copy-paste it on your infographic. Now, position it and choose a color. ​
   - You can experiment by adding drop shadows to certain elements. To do so, select and element and click on Filters>​Shadows and Glows>​Drop shadow.   - You can experiment by adding drop shadows to certain elements. To do so, select and element and click on Filters>​Shadows and Glows>​Drop shadow.
   - Export your infographic in PNG format. ​   - Export your infographic in PNG format. ​
   - Here is an example of a {{::​cougar_infographique.png?​linkonly|completed infographic}}. ​   - Here is an example of a {{::​cougar_infographique.png?​linkonly|completed infographic}}. ​
  
- 
- 
-==== Exercise 7 - GIFs! ==== 
- 
-You will be making a GIF animation that highlights how cool your research is!  
- 
-  * Find some photos or graphs from your research that you want to highlight. ​ 
-  * Click on File>New and select a 640x480 document with a White background. ​ 
-  * Open the content you want to put in the animation in GIMP and copy it as new layers using Edit>​Paste as...>​New layer. Resize the content to fit into the page using the Scale Tool.  
-  * Reorder the layers, knowing that the bottom layer will be played first and the top layer last.  
-  * Change the name of each layer to designate the associated content. After the name of the layer add (500ms) to get something like: "First photo(500ms)"​. The number in parenthesis is the duration of this slide in the GIF animation. ​ 
-  * For slides with text, click on the Text tool and and choose the font and font size from the Tool options before adding the text. When you are done placing and resizing the text, add (500ms) to the name of the text layer. ​ 
-  * To give a background to your text, first choose a foreground color by clicking on the Foreground and Background Color icon. Then, add an empty layer to the bottom of the text (by clicking the Create a new layer icon {{::​add_layer_icon.png?​nolink|}}) that has that foreground color. When satisfied with both the text and the background, right click on the text layer and choose Merge Down. The text is now fused with the background and you can't remove it.  
-  * You can test your animation by clicking on Filters>​Animate>​Playback. ​ 
-  * When you are happy with your work, choose File>​Export as>GIF Image, and then click on As animation, leaving the other options unmodified. If it asks if you want to crop, click yes.  
-  * You can now open your animation in a web browser! ​