[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ next ]


Some Mini-Howtos of Interest
Chapter 9 - Graphic Edition


9.1 Include greek characters in inkscape

Find the unicode number corresponding to the greek character you want to include. Tables of codes can be found in Unicode Charts. For example, the unicode for the alpha symbol is 03b1.

In a text cell type Ctrl-u, include the unicode key of the greek letter and press enter.


9.2 Include greek characters in Gimp

Find the unicode number corresponding to the Greek character you want to include. Tables of codes can be found in Unicode Charts. For example, the unicode for the alpha symbol is 03b1.

In a text cell type Ctrl-Shft-u, include the unicode key of the Greek letter and press enter.


9.3 Change the text baseline in inkscape

In order to include sub and super-indexes in inkscape you can change the text base line in a text cell using the keys:

Alt-Up and Alt-Down.


9.4 Use ImageMagick to transform graphic files

Updated on July 06th, 2014; September 22nd, 2016.

You can easily transform a graphic file from the console using the tool convert from the ImageMagick suite. Imagine for example that we start with the file foto_0.png.

      
     $ identify foto_0.png 
     foto_0.png PNG 1209x1710 1209x1710+0+0 DirectClass 8-bit 2.63038mb

We have made use of the command identify, that is also part of the ImageMagick suite and describes the format and characteristics of image files. There are several ways to resize the file. The common syntax is convert -resize geometry. From the many possible ways of expressing the geometry change we present three useful options:

  1. scale%: Height and width scaled by the specified percentage scale.

  1. width: Width fixed to width and height automatically rescaled to conserve aspect ratio.

  1. xheight: Height fixed to height and width automatically rescaled to conserve aspect ratio.

We present examples of the three possibilities[15]:

      
     $ identify foto_0.png 
     foto_0.png PNG 1209x1710 1209x1710+0+0 DirectClass 8-bit 2.63038mb 
     $ convert -depth 8 -resize 50% foto_0.png foto_1.png
     $ identify foto_1.png 
     foto_1.png PNG 605x855 605x855+0+0 DirectClass 8-bit 681.391kb 
     $ convert -depth 8 -resize 1024 foto_0.png foto_2.png
     $ identify foto_2.png 
     foto_2.png PNG 1024x1448 1024x1448+0+0 DirectClass 8-bit 1.82886mb 
     $ convert -depth 8 -resize x800 foto_0.png foto_3.png
     $ identify foto_3.png 
     foto_3.png PNG 566x800 566x800+0+0 DirectClass 8-bit 601.271kb

Apart from resizing images we can also transform from an image format to a different one. For example, to convert from encapsulated postscript (eps) to png format:

      
     $ identify bsplot_N40.eps 
     bsplot_N40.eps PS 613x661 613x661+0+0 16-bit DirectClass 20.4KB 0.000u 0:00.000
     $ convert bsplot_N40.eps bsplot.png
     $ identify bsplot.png 
     bsplot.png PNG 613x661 613x661+0+0 8-bit PseudoClass 6c 8.64KB 0.000u 0:00.000

Convert can be also used to stack horizontally or vertically several images. For example, the command

      
     $ convert Glacial_Map_0.jpg Glacial_Map_1.jpg Glacial_Map_2.jpg +append test.png

will produce a file test.png that includes the three figures appended in a row. To append them vertically the option is -append.


9.4.1 References

  1. Linux Journal, issue 185, Sept. 2009


9.5 Enhancing colors and resolution in Gimp

A Gimp filter that improves and sharpen lines when colors are too weak can be found in

      
     Filters -> Enhance -> Unsharp Mask

9.6 Remove the background of an image in Gimp

In order to remove the background of an image using Gimp a possible (easy) recipe is the following-,

  1. Using the lasso tool (also known as Free Select Tool) make a rough selection around the image that you want to remove the background from.

  1. Activate the quick mask tool by selecting the little square at the bottom left side of the main image window. Using this tool the selection can be refined.

  1. Using the pencil tool shade the background more precisely around your image. If you make a mistake you can either use Ctrl Z to undo your last action or change the pencil to white which will remove the mask.

  1. Toggle the quick mask off, copy the image, and paste as new. This will result in a background-free copy of your image.

  1. To refine the final result, add alpha to the selection (from the layers tool). Then, from the Select menu: (a) invert the selection, (b) feather the selection by 1 or 2 pixels, (c) Ctrl + k to clear, and (d) Ctrl + Shift + A to unselect.

  1. Save your image.


9.7 Take a screenshot using Gimp

In order to take a screenshot of the full display, a window, or part of a window launch Gimp and select

      
     File -> Create -> ScreenShot...

It is convenient to fix a time delay to be able to select the right window to grab the region of interest.


9.8 Change the color of markers in inkscape

Added on July 06th, 2014.

In order to change the color of markers (e.g. arrows end and start) in inkscape to coincide with the color of the stroke of the object they belong to the following effect should be enabled.

Extensions > Modify Path > Color Markers to Match Stroke

If


9.8.1 References

  1. Inkscape FAQ


9.9 Modify the canvas size of a Gimp file

Added on November 10th, 2018

The canvas is the visible area of the Gimp image. By default the canvas and layers size coincides. The Canvas Size command lets you enlarge or reduce the canvas size. You can also modify the size of the layers. You can access this command from the image menubar through Image -- Canvas Size.

When you enlarge the canvas, you create free space around the contents of the image. When you reduce it, the visible area is cropped, however the layers still extend beyond the canvas border.

When you reduce the canvas size, the new canvas appears surrounded with a thin negative border in the preview. The mouse pointer is a moving cross: click and drag to move the image against this frame.


9.10 Terminal app to extract images from a pdf file

Added on October 24th, 2017.

If you need to extract images from a pdf file a convenient terminal application is pdfimages. For example if we need to extract the images from a file named article.pdf you can proceed as follows

         $ pdfimages -all article.pdf ./article_images
         $ ls
     article.pdf  article_images-003.tif  article_images-006.tif
     article_images-000.tif   article_images-004.pbm  article_images-007.tif
     article_images-001.tif   article_images-004.png
     article_images-002.tif   article_images-005.tif

The article contains seven images. The options -all indicate that JPEG, JPEG2000, JBIG2, and CCITT images are extracted in their native format while CMYK files are written as TIFF files and all other images are written as PNG files.


9.10.1 References

  1. Howto Geek 228796


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ next ]


Some Mini-Howtos of Interest

Curro Perez-Bernal mailto:francisco.perez@dfaie.uhu.es