Draw Guide 7.4

Chapter 6,
Editing Images
Raster Graphics

CopyrightThis document is Copyright © 2023 by the LibreOffice Documentation Team. Contributors arelisted below. This document maybe distributed and/or modified under the terms of either the GNU
General Public License (https://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative
Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), version 4.0 or later.
All trademarks within this guide belong to their legitimate owners.

Contributors
Contributors for this edition:Peter Schofield

Contributors for previous editions:
Claire Wood
Elzett Kotze
Jean Hollis WeberJohn A Smith
John Cleland
Kees Kriek

Martin Fox
Peter Schofield
Regina HenschelFeedback
Please direct any comments or suggestions about this document to the Documentation Team
mailing list: loguides@community.documentfoundation.org.

Note
Everything sent to a mailing list, including email addresses and any otherpersonal information that is written in the message, is publicly archived andcannot be deleted.

Publication date and software version
Published 2023. Based on LibreOffice 7.4 Community.
Other versions of LibreOffice may differ in appearance and functionality.

Using LibreOffice on macOS
Some keystrokes and menu items are different on macOS from those used in Windows andLinux. The table below gives some common substitutions used in this document. For a detailed
list, see LibreOffice Help.
Windows or LinuxmacOS equivalent

EffectTools > Options
menu selection

LibreOffice > Preferences

Access setup options

Right-click

Control+click, Ctrl+click, or rightOpen a context menu
click depending on computer setup

Ctrl or Control⌘ and/or Cmd or Command,
depending on keyboard

Alt⌥ and/or Alt or Option depending
Used with other keys
on keyboard

F11

⌘+T

Used with other keys

Open the Styles deck in the
SidebarDocumentation for LibreOffice is available at https://documentation.libreoffice.org/en/Contents
Copyright.......................................................................................................................... 2
Contributors................................................................................................................................2
Feedback....................................................................................................................................2
Publication date and software version........................................................................................2
Using LibreOffice on macOS......................................................................................................2

Introduction...................................................................................................................... 4
Importing images.............................................................................................................4
Inserting......................................................................................................................................4
Embedding..................................................................................................................................5
Linking........................................................................................................................................5
Editing links.................................................................................................................................6
Scanning.....................................................................................................................................7
Copying and pasting...................................................................................................................8
Dragging and dropping...............................................................................................................8

Exporting graphics.......................................................................................................... 8
Exporting files.............................................................................................................................8
Exporting objects........................................................................................................................8

Formatting images (raster objects)................................................................................9
Naming images...........................................................................................................................9
Image toolbar............................................................................................................................10

Cropping images............................................................................................................13
Quick cropping..........................................................................................................................13
Crop dialog...............................................................................................................................14
Exporting cropped graphics......................................................................................................15
Compressing images................................................................................................................15

Image filters....................................................................................................................16
Replacing colors............................................................................................................23
Color Replacer dialog...............................................................................................................24
Replacing colors.......................................................................................................................24
Replacing transparent areas....................................................................................................25

Conversion..................................................................................................................... 26
Contour conversion...................................................................................................................26
Polygon conversion..................................................................................................................26
Conversion options and controls.........................................................................................27
Converting...........................................................................................................................28
Breaking...............................................................................................................................28
Splitting................................................................................................................................28
Bitmap conversion....................................................................................................................29

Chapter 6, Editing Images | 3

Introduction
Previous chapters in this Draw Guide have dealt only with vector graphics and the most common
types of vector graphics in use are as follows:
SVG (Scalable Vector Graphics)
An Extensible Markup Language (XML) based vector image format for two-dimensionalgraphics with support for interactivity and animation.
EPS (Encapsulated PostScript)
A PostScript document format usable as a graphics file format. EPS files are more-or-lessself-contained, reasonably predictable PostScript documents that describe an image or
drawing and can be placed within another PostScript document.
AI (Adobe Illustrator)
A proprietary file format developed by Adobe Systems for representing single-page
vector-based drawings in either the EPS or PDF formats.
However, Draw also contains a number of functions for handling raster graphics or bitmaps suchas photographs and scanned pictures, including import, export, and conversion from one format
to another.
Draw can read the majority of graphic file formats. It has a subset of capabilities similar to rastergraphics programs like Gimp or Adobe Photoshop. Raster graphics are generally images or
pictures that use the most common formats in use:
JPG/JPEG
Acronym for Joint Photographic Experts Group which created the format. It is the mostcommon image format on websites and most digital cameras produce JPEG images asdefault.
GIF (Graphics Interchange Format)
GIF is a bitmap image format that is popular because of its wide support and portability.
PNG (Portable Network Graphics)
PNG is a raster image format which supports lossless data compression and also
background transparency.
TIF/TIFF (Tagged Image File Format)
TIFF is flexible, adaptable, and capable of storing image data in a lossless format.
BMP (BitMaP)
Also known as bitmap image file, which is a dot matrix data structure.

Importing images
Inserting
To import image files into a drawing, go to Insert > Image on the Menu bar to open the Insert
Image dialog (Figure 1).
Draw contains import filters for the majority of graphic formats. If the file being imported has agraphic format not covered by the import filters, then it is recommended to use one of the many
free graphic conversion programs to convert the file into a format that Draw recognizes.
If Preview is selected in the Insert Image dialog, a preview of the file is shown in the box on theright-hand side. This makes it easier to select the file required and also checks that Draw canimport the file format used.

4 | Chapter 6, Editing Images

Figure 1: Insert Image dialog

Embedding
Embedding a graphic into a drawing makes the image a permanent part of the drawing. Anychanges made to an embedded graphic only appear in the drawing where the graphic wasembedded. The original graphic file is not affected. Embedding happens when a graphic is
imported into a drawing using one of the following methods:• Insert Image dialog.
• Copying and pasting.
• Scanning a graphic.
• Dragging and dropping between open files.
The main advantage of embedding graphics into a drawing is that the graphic is always available
no matter what computer is used to open the drawing.
The main disadvantage of embedding graphics is that it creates large file sizes, which may not bedesirable if there is limited capacity for storing computer files. Also, if the original graphic is
altered, then the embedded graphic is not updated each time the drawing is opened.

Note
When a graphic is to be embedded into a LibreOffice drawing, make sure that theInsert as Link option is not selected in the Insert Image dialog.

Linking
Linking to the original graphic does not insert the graphic into a drawing, but creates a link towhere the original graphic file is located on the computer. Each time the drawing is opened, anylinked graphics are displayed in the drawing.

Importing images | 5

Figure 2: Confirm Linked Graphic dialog
The main advantage of linking a graphic file when inserted into a drawing is that if the originalgraphic file is altered or replaced with a graphic using the same filename, the version of thegraphic in the drawing is always up to date. The next time the drawing is opened, the latest
version of the graphic is also opened in the drawing. Also the file size of the drawing is muchsmaller and the original graphic can easily be edited with specialized external applications.
The main disadvantage of linking graphics is that the link must be maintained between thedrawing and the embedded graphic file for linking to work correctly. If the drawing or originalgraphic file is moved to another computer location, then any links must be updated to include the
new location.
1) Open the Insert Image dialog.
2) Select Insert as Link in the Insert Image dialog.
3) Select the required graphic file and click on Open to open the Confirm Linked Graphic
dialog (Figure 2).
4) Click on Keep Link to link the file and close the Confirm Linked Graphic dialog.
5) If necessary, click on Embed Graphic to embed the file if it is not to be linked. This also
closes the Confirm Linked Graphic dialog.

Note
When a graphic file is linked to a LibreOffice drawing, the format of the linked
graphic is not changed.

Editing links
Links can be updated, modified, or broken as follows:
1) Go to Edit > Links to External File on the Menu bar to open the Edit Links dialog(Figure 3).
2) Select the link to be edited.
3) Click on Modify, Break Link, or Update as appropriate.
– Modify — changes the graphic file in the drawing to the graphic file that uses theselected link.
– Break Link — breaks the link between the selected file and the current document.
The version of the graphic file in the drawing becomes embedded into the drawing. A
confirmation dialog opens asking if the link is to be broken. Click on Yes to confirm
the breaking of the link.

6 | Chapter 6, Editing Images

Figure 3: Edit Links dialog– Update — updates the selected link so that the most recent version of the linked fileis displayed in the drawing.
4) Click on Close to save the changes to the link and close the Edit Links dialog.

Scanning
With most scanners, a scanned image can be inserted into a drawing or document. Scanned
images are embedded using PNG format. Make sure the scanner is configured for the computerand supported by the SANE system for a Linux operating system, or TWAIN for a Windows or
Mac operating system.
The following procedure is an example only. The actual scanning procedure depends on thescanner driver, interface, and computer operating system. Consult the documentation that camewith the scanner for more information.
1) Place a document, drawing, or photograph in the scanner and make sure that the scanneris switched on and ready.
2) If this is the first time the scanner has been used with LibreOffice, go to Insert > Media >Scan > Select Source on the Menu bar to select the scanner. If the scanner has beenused before, go to Insert > Image > Scan > Request on the Menu bar.
3) Specify the scanning resolution, what is being scanned, and so on.
4) When the image has been scanned, Draw places it in the drawing. At this point it can beedited like any other graphic.

Note
If more than one scanning device is connected to the computer, the device isselected when the source is selected. This selection becomes the default source
when using scan requests until another device is selected and used as thescanning source.

Importing images | 7

Copying and pasting
Copying and pasting a graphic into a drawing is another way of embedding graphics. The copiedgraphic can be an image already embedded in another document or drawing, or it can be agraphic file such as a drawing, document, or photograph.
After copying, select the format for pasting a graphic into Draw using Edit > Paste Special >Paste Special on the Menu bar to open the Paste Special dialog. Available formats for pasting
depend on the type of image copied onto the clipboard.

Note
When copying and pasting images into a drawing, please respect the copyrightand license of the image being copied.

Dragging and dropping
Dragging and dropping to embed graphics into a drawing can be used on graphics that havebeen embedded or linked. The way that dragging and dropping works is determined by thecomputer operating system. Behavior of dragging and dropping is normally controlled using theCtrl or Ctrl+Shift keys (macOS ⌘ or ⌘+Shift) in combination with the cursor.
Objects and images which are used frequently can be stored in the Draw Gallery. From theGallery, a copy of the object or image can be simply dragged onto the drawing. Working with theGallery is dealt with in Chapter 11, Advanced Draw Techniques.

Exporting graphics
Exporting files
By default Draw saves drawings in the ODG format and some software programs cannot open
these files. To make drawings available for other programs, the file can be exported in various
formats. The export procedure used depends on the computer setup and computer operating
system being used. The following procedure is an example export procedure.
1) Open the ODG file being exported.
2) Go to File > Export on the Menu bar and open the Export dialog. An example of anexport dialog is shown in Figure 4.
3) Enter a new filename for the exported file and navigate to the folder where the exported
file is to be saved.
4) Select the required file format from the options in the drop-down list.
5) Click Export and the file is exported as a new file in the selected file format.
6) Depending on the file format selected, another dialog may open allowing options to be
selected for the export format.
7) Depending on the additional dialog that may open, click on Export, Create, or OK and
the file is exported as a new file in its new format.

Exporting objects
Exporting individual objects, or a group of objects, from a drawing file is similar to “Exporting files”
above. Open a drawing file and then select the object or objects for export. Make sure to choose
the Selection option in the export dialog, as shown in Figure 4. Using this method, an imported
image can be modified, annotations added to it, and make any other changes, then select it andexport for use in another drawing or document.
8 | Chapter 6, Editing Images

Figure 4: Example of an export dialog

Formatting images (raster objects)
Images (raster graphics) can be edited and formatted using one of the following methods to add
or change filters and adjust the properties of color, lines, areas, and shadows:• Go to Format > Image on the Menu bar and use one of the tools in the sub-menu that
opens.
• Use the tools on the Image toolbar (Figure 5). See “Image toolbar” below for more
information.
• Use the tools available in the Image panel on the Properties deck of the Sidebar.
• Some raster graphics may have a text element. For more information on formatting text,
see Chapter 9, Adding and Formatting Text.
Raster graphics included in a group behave like other objects when the properties of the groupare edited and formatted.

Note
Formatting changes made to a graphic using the tools in LibreOffice only appear
in the drawing where the graphic was modified. Original graphic file is notaffected.

Naming images
Draw names objects, including inserted images, Shape 1, Shape 2, and so on, in the order of
insertion into a drawing. It is recommended to rename objects, including images in a drawing,with a unique name. Names make images and other objects easily identifiable in the LibreOffice
Navigator.
Formatting images (raster objects) | 9

Figure 5: Image toolbar
1) Select an image, then use one of the following methods to open the Name dialog andcreate a unique name for the selected image:– Go to Format > Name on the Menu bar.
– Right-click on the image and select Name from the context menu.
2) Enter a name in the Name text box in the Name dialog that opens and click OK.

Image toolbar
The Image toolbar (Figure 5) appears when an image or picture that is a raster graphic isselected. The Image toolbar can be fixed at the top of a drawing or as a floating toolbar. For more
information on the Image toolbar and the available tools, see Appendix B, Toolbars.
Position and Size (F4)
Opens the Position and Size dialog. See Chapter 3, Working with Objects for more
information.
Align Objects
Opens a sub-toolbar giving access to alignment tools for aligning selected objects inrelation to each other. See Chapter 5, Combining Multiple Objects for more information.
Bring to Front
Brings the selected object to the front of a group of objects (Ctrl+Shift++)(macOS ⌘+Shift++).
Bring Forward
Brings the selected object forward one step (Ctrl++) (macOS ⌘++).
Send Backward
Sends the selected object one step backward (Ctrl+–) (macOS ⌘+–).
Send to Back
Sends the selected object to the back of a group of objects (Ctrl+Shift+–)(macOS ⌘+Shift+–).
In Front of Object
Moves the selected object in front of another selected object.
Behind Object
Moves the selected object behind another selected object.
Reverse
Reverses the order of the selected objects. This tool is grayed out if only one object isselected.
Line Style
Opens a drop-down list with different line styles used for the outline of the border. See
Chapter 4, Changing Object Attributes for more information.

10 | Chapter 6, Editing Images

Line Width
Used to change the width of a line. See Chapter 4, Changing Object Attributes for more
information.
Line Color
Used to change the color of a line. See Chapter 4, Changing Object Attributes for more
information.
Area Style/Filling
Used to change the type of filling used in a shape. See Chapter 4, Changing Object
Attributes for more information.
Shadow
Sets the default shadow effect around the picture. The shadow attributes are adjusted
using the Shadow panel in the Properties deck on the Sidebar (Figure 6). See Chapter 4,
Changing Object Attributes for more information.

Figure 6: Image and Shadow panels in Properties deck on Sidebar

Formatting images (raster objects) | 11

Figure 7: Color toolbar
FilterOpens the Image Filter toolbar which is described in “Image filters” on page 16.
Image Mode
Changes the display of the graphic from color to grayscale, black and white, or awatermark. This setting affects only the display and printing of the picture; the original
picture file remains unchanged. The image mode setting can also be changed using
Color mode in the Image panel in the Properties deck on the Sidebar (Figure 6).
Default
Graphic is displayed unaltered in color.
Grayscale
Graphic is displayed in 256 shades of gray.
Black/White
Graphic is displayed in black and white.
WatermarkColor, brightness, contrast, and gamma settings are reduced so that the graphic can beused as a watermark (background). The default settings for Watermark can be adjusted
using the Color toolbar (Figure 7).
Crop Image
Crops or trims a picture. When using this tool, crop marks appear around the picture.
Drag one or more of these marks to crop the picture to the desired size. For more
information on cropping, see “Cropping images” on page 13.
Vertically
Flips the selected object vertically. See Chapter 4, Changing Object Attributes for more
information.
Horizontally
Flips the selected object horizontally. See Chapter 4, Changing Object Attributes for more
information.
Transformations
Opens the Transformations toolbar. See Chapter 4, Changing Object Attributes for more
information.
Transparency
Adjusts the degree of transparency of the picture between 0% (opaque) and 100% (fullytransparent). The transparency setting can also be adjusted using the Image section in
the Properties deck on the Sidebar.
12 | Chapter 6, Editing Images

ColorOpens the Color toolbar (Figure 7) to adjust the values of the RGB colors, brightness,
contrast, and Gamma. These adjustments do not affect the original picture, but the values
are stored in Draw as a separate formatting set. The color settings can also be adjusted
using the Image section in the Properties deck on the Sidebar.
Red, Green, Blue
Select values between –100% (no color) to +100% (full intensity); 0% represents theoriginal color value of the graphic.
Brightness
Select a value between –100% (totally black) and +100% (totally white).
Contrast
Select a value between –100% (minimum) and +100% (maximum).
Gamma
Affects the brightness of the middle color tones. Select a value between 0.10
(minimum) to 10 (maximum) Try adjusting this value if changing brightness or contrast
does not give the required result.

Cropping images
Cropping is a method of hiding unwanted areas of an image or changing the size of an image ina drawing. Changes made when cropping an image only change the display of the graphic in a
drawing and not the original graphic file.

Quick cropping
After selecting a graphic, it can be cropped quickly using one of the following methods:• Click on Crop Image on the Standard or Image toolbar.
• Go to Format > Image > Crop on the Menu bar.
• Right-click on the image and select Crop from the context menu.

Figure 8: Example image in crop mode

Cropping images | 13

Figure 9: Crop dialog
Selection handles appear around the selected image (Figure 8) and the image is cropped asfollows:• Top, bottom, left, and right selection handles crop the image in one direction only.
• Corner selection handles crop the image vertically and horizontally in two directions.
• To maintain the ratio between vertical and horizontal dimensions, hold down the Shift
key while moving a selection handle.

Crop dialog
For more control and accuracy over the cropping functions, it is recommended to use the Cropdialog (Figure 9). After selecting an image, go to Format > Image > Crop Dialog on the Menu
bar to open the Crop dialog.
Crop
Use this section to trim or scale the selected graphic, or to add white space around thegraphic.
Keep scale
Maintains the original scale of the graphic when cropping so that only the size of thegraphic changes.
Keep image size
Maintains the original size of the graphic when cropping so that only the scale of thegraphic changes. To reduce the scale of the graphic, select this option and enter
negative values in the cropping boxes. To increase the scale of the graphic, enter
positive values in the cropping boxes.

14 | Chapter 6, Editing Images

Left and Right
If Keep scale is selected, enter a positive amount to trim the left or right edge of thegraphic, or a negative amount to add white space to the left or right of the graphic. If
Keep image size is selected, enter a positive amount to increase the horizontal scale of
the graphic, or a negative amount to decrease the horizontal scale of the graphic.
Top and Bottom
If Keep scale is selected, enter a positive amount to trim the top or bottom of thegraphic, or a negative amount to add white space above or below the graphic. If Keep
image size is selected, enter a positive amount to increase the vertical scale of thegraphic, or a negative amount to decrease the vertical scale of the graphic.
Scale
This section is used to change the scale of the selected graphic as it appears in a
drawing.
WidthEnter a percentage value to change the width of a selected graphic.
HeightEnter a percentage value to change the height of a selected graphic.
Image Size
This section is used to change the size of the selected graphic.
WidthEnter a value for the width of the selected graphic.
HeightEnter a value for the height of the selected graphic.
Original Size
Original size of the graphic is displayed above the option. Clicking on this option and thenclicking OK resets the selected graphic to its original size.

Note
In the Crop dialog, the Width and Height are treated as independent values.
Changing one without the other can result in significant distortion of the image
and this may not be what is required.

Exporting cropped graphics
If a cropped graphic is to be used in another drawing, use one of the following methods after
selecting the cropped graphic:• Go to File > Export on the Menu bar to open the Export dialog. Navigate to thedestination folder, then enter a filename, choose the Selection option, and click on
Export. See “Exporting graphics” on page 8 for more information.
• Go to Format > Image > Save on the Menu bar or right click on the cropped graphic andselect Save from the context menu. Click on Yes to save the modified image and open
an Image Export dialog. Select the file format required, navigate to the destination folder,then enter a filename and click on Save.

Compressing images
If a large image is inserted into a drawing and resized to fit into the layout of the drawing, thecomplete full-size original image is stored in the drawing file. This preserves its content, possibly
resulting in a large file to store or send by mail.

Cropping images | 15

Figure 10: Compress Image dialog
If some loss of image quality can be accepted, the image can be compressed reducing its data
volume while preserving its display in the page layout;
1) Open the Compress Image dialog (Figure 10) using one of the following methods:– Right-click on the image and select Compress from the context menu.
– Go to Format > Image > Compress on the Menu bar.
2) Select the type of compression and the resolution required.
3) Click on Calculate New Size to update the image information when the Compression
and Resolution settings are changed.
4) When satisfied with the new settings, click OK to apply the settings.
5) If the resulting image is not acceptable, use one of the following methods to undo thechanges and select another compression setting.
– Keyboard shortcut Ctrl+Z (macOS ⌘+Z).
– Go to Edit > Undo on the Menu bar.

Image filters
Draw offers eleven filter effects that work on a selected graphic and they can be combined.
Filters always apply to the entire image and it is not possible to use filters to edit only a part of theimage.
1) Select an image to open the Image toolbar.
2) Apply an image filter using one of the following methods:– Click on Filter to open the Image Filter sub-toolbar (Figure 11), then select an image
filter to apply.
– Go to Format > Image > Filter on the Menu bar and select an image filter from thecontext menu.

16 | Chapter 6, Editing Images

Figure 11: Image Filter sub-toolbar

Notes
If an image is embedded into a drawing, any image filters are applied directly to aselected image and the original image file is not changed. Save the drawing toretain any filter effects applied to an image in a drawing.
After a drawing is saved and closed, the effects of image filters become
permanent. If image filter effects are not satisfactory, use Edit > Undo on the
Menu bar to cancel the filter effects before saving the drawing.
When applying image filters to an image, the file size of the image must be taken
into account. On large file sizes, there is a time lag between applying an image
filter and the effect to be visible on the image.
Figure 12 is an example of an image with no image filters applied. The image filters available on
the Image Filter sub-toolbar are as follows with examples of the filter effect on the image.

Figure 12: Example image — no filter applied
InvertInverts or reverses the color values of a color image (similar to a color negative), or thebrightness values of a grayscale image. Apply the filter again to revert to the originalgraphic (Figure 13).

Figure 13: Example of Invert filter

Image filters | 17

SmoothSoftens or blurs the image by applying a low pass filter. This reduces the contrast
between neighboring pixels and produces a lack of sharpness making the image appear
smoother. The effect of the smooth filter can be very subtle. Figure 14 shows the effect ofapplying a Smooth radius of 4 to an image.
Selecting this filter opens the Smooth dialog (Figure 15) where the smooth radiusparameter is set. The preview in the Smooth dialog shows the effect of applying the
Smooth filter to an image.

Figure 14: Example of Smooth filter

Figure 15: Smooth dialog
SharpenSharpens the image by applying a high pass filter, adjusting the contrast between
neighboring pixels. The effect increases if the filter is applied several times making thecolors appear faded, as shown by the example in Figure 16.
Remove Noise
Removes noise by applying a median filter comparing every pixel with its neighbor. It thenreplaces any pixel with extreme values that deviate in color by a large amount from themean value with a pixel that has a mean color value. The amount of picture information
does not increase each time the filter is applied. However, there are fewer contrast
changes resulting in an image that looks smoother and the effect is very subtle(Figure 17).

18 | Chapter 6, Editing Images

Figure 16: Example of Sharpen filter

Figure 17: Example of Remove Noise filter

Figure 18: Example of Solarization filter
Solarization
Solarization refers to an effect that looks like what can happen when there is too muchlight during photo development and the colors have become partly inverted. Dark areas
appear light or light areas appear dark. In the digital world of photography, solarization
creates a change or reversal of color, similar to the effect of the Invert image filter.
Figure 18 shows the effect of a Solarization filter applied using a threshold value of 50%
Selecting Solarization opens the Solarization dialog (Figure 19), where the degree ofsolarization (Threshold value) can be specified. Entering a Threshold value above 70%
reverses the inversion effect on colors. Also, selecting Invert reverses the effect of the
Solarization image filter, as shown in the preview box in Figure 19.
Image filters | 19

Figure 19: Solarization dialog
Aging
Aging creates a look that resembles photographs developed in the early days ofphotography (Figure 20). All pixels are set to their gray values and then the green andblue color channels are reduced by the amount specified in Aging degree in the Aging
dialog. Red color channel is not changed.
Selecting the Aging filter opens the Aging dialog (Figure 21), where the Aging degree canbe defined and create an old look for an image.

Figure 20: Example of Aging filter

Figure 21: Aging dialog

20 | Chapter 6, Editing Images

Posterize
Posterizing reduces the number of colors in an image. For example, a photograph willprobably look like a painting when the number of colors is reduced (Figure 22). Selecting
Posterize opens the Posterize dialog (Figure 23), where the number of Poster colors canbe defined to produce the effect required.

Figure 22: Example of Posterize filter

Figure 23: Posterize dialog
Pop ArtChanges the colors of an image converting it to a pop-art format (Figure 24).

Figure 24: Example of Pop Art filter

Image filters | 21

Charcoal Sketch
Displays an image as a charcoal sketch. The contours of the image are drawn in blackand the original colors are suppressed (Figure 25).

Figure 25: Example of Charcoal Sketch filter
ReliefCalculates the edges of an image in relief as if the image is illuminated by a light source(Figure 26). Selecting Relief opens the Emboss dialog (Figure 27) where the position of
the Light source is selected producing shadows that differ in direction and magnitude.

Figure 26: Example of Relief filter

Figure 27: Emboss dialog

22 | Chapter 6, Editing Images

Mosaic
This image filter joins groups of pixels and converts them into rectangles of a single color
creating an image that appears to be a mosaic (Figure 28). The larger the individual
rectangles created, the fewer details in the mosaic graphic.
Selecting this image filter opens the Mosaic dialog (Figure 29), where the number ofpixels for Width and Height of the tiles is set. Selecting Enhanced edges enhances theedges of each tile, creating a sharper definition.

Figure 28: Example of Mosaic filter

Figure 29: Mosaic dialog

Replacing colors
The Color Replacer only allows replacement or changing a color in an embedded graphic foranother color or set a color as transparent. Up to four colors can be replaced at once. An area of
the graphic cannot be selected for editing as this tool only works on the entire graphic.
The selection of replacement colors can only be from one of the available palettes in LibreOffice.
New colors cannot be defined here, but custom colors can be created before using the Color
Replacer. For more information on creating colors, see Chapter 11, Advanced Draw Techniques.

Note
The Color Replacer can only be used on embedded graphics. If the Color
Replacer is used on a linked graphic, the following error message appears “Thisimage is linked to a document. Do you want to unlink the image in order to edit
it?”. Click on Yes to unlink and embed the graphic.

Replacing colors | 23

Color Replacer dialog
PipetteSwitches color selection on when selected.
Replace
Replaces the selected source colors in the selected image with the colors specified in the
Replace with boxes.
ColorsLists the source colors and the replacement colors.
Source color
Select this checkbox to replace the current Source color with the color that specified in
the Replace with box.
Tolerance
Set the tolerance for replacing a source color in the source image. To replace colors
that are similar to the color selected, enter a low value. To replace a wider range ofcolors, enter a higher value.
Replace with
Lists the available color palettes and replacement colors.
Transparency
Replaces transparent areas in the selected image with the color selected.

Replacing colors
1) Select an embedded image to start using the Color Replacer.
2) Go to Tools > Color Replacer on the Menu bar to open the Color Replacer dialog(Figure 30).
3) Click on Pipette at the top of the Color Replacer dialog to activate the color selectionmode.
4) Move the cursor over the color to be replaced in the selected image and a preview of thecolor appears in the box next to Pipette.
5) Click on the color. The selected color appears in the first Source color preview box and acheck mark appears next to it.

Figure 30: Color Replacer dialog
24 | Chapter 6, Editing Images

Figure 31: Example image

Figure 32: Example of replacing colors
6) To select another color, place a check mark next to the second Source color preview box
and click on another color in the selected image. A maximum of four colors can beselected in the Color Replacer dialog.
7) Enter the amount of tolerance required for replacing each selected color in the Toleranceboxes. The default selection is 10% tolerance.
8) In Replace with, select a color palette from the drop-down list, then select the required
color from the color palette. Transparent is the default selection.
9) After selecting up to four colors for replacement, click Replace to replace the colors in theselected graphic. Examples of the original image and after color replacement to the image
are shown in Figures 31 and 32.
10) There is no preview of the effect. If the result is not satisfactory, select Edit > Undo >Color Replacer in the Menu bar and repeat the color replacement.

Notes
Using the Color Replacer replaces all occurrences of the Source color that are in
the selected image.
The default selection of Transparent in the Replace with boxes removes theselected color from the image and creates transparent areas in the selected
image.

Replacing transparent areas
To replace any transparent areas in an image with a color use the following procedure:
1) Go to Tools > Color Replacer on the Menu bar to open the Color Replacer dialog.

Replacing colors | 25

2) Select an image with transparent areas.
3) Select Transparency in the Color Replacer dialog so that a check mark appears next toTransparency.
4) Select a color palette from the drop-down list next to Transparency, then select a color
from the selected palette.
5) Click on Replace and the transparent areas are filled with the selected color.
6) There is no preview of the effect. If the result is incorrect, select Edit > Undo > Image
Color Replacer in the Menu bar.

Conversion
Contour conversion• Contour conversion converts a selected object to a polygon, or a group of polygons, withfour corner points.
• Converting an image to a contour, the converted image is set as a background graphic.
• If the conversion creates a group of polygons (for example, contour conversion of a text
object). Enter the polygon group before selecting an individual polygon within the group.
For more information on working with groups, see Chapter 5, Combining Multiple
Objects.
• After converting an image to a contour, the object can no longer be edited normally. The
converted image has to be edited using Edit > Points on the Menu bar to adjust its
shape. For more information on editing points, see Chapter 3, Working with Objects.

Notes
Any editing to an object must be completed before carrying out a contour
conversion because any further normal editing is not possible on the converted
object.
No confirmation dialog is provided for a contour conversion.
1) Carry out all necessary editing on the object before converting to a contour.
2) Make sure the object is selected.
3) Convert the object to a contour using one of the following methods:– Go to Shape > Convert > To Contour on the Menu bar.
– Right-click on the selected object and select Convert > To Contour from the context
menu.

Polygon conversion
Polygon conversion is used to convert a selected image into a group of polygons filled with color.
The image is also converted to a vector graphic and can be resized with no loss of image quality
or distortion of any text. After conversion, the graphic can be broken into groups of polygons andthen split into individual polygons. Breaking and splitting allows editing or deletion of individualcolors within the graphic.

26 | Chapter 6, Editing Images

Conversion options and controls
Number of colors
Enter the number of colors to be displayed in the converted image. LibreOffice generates
a polygon for each occurrence of a color in the image. The range for the number of colors
is between 8 and 32.
Point reduction
Removes color polygons that are smaller than the pixel value entered. The range for point
reduction is between 0 and 32 pixels.
Fill holes
Fills the blank areas in the graphic that can be created when applying a point reduction.
Tile size
Enter the size of the rectangle for the background fill. Tile sizes range between 8 and 128
pixels.
Source image
Preview of the original image.
Vectorized image
Preview of the converted image.
Preview
Creates a preview of the converted image in Vectorized image without applying any
changes.
OK
Converts the image to a vector graphic consisting of polygons. The result is a metafile in
SVM format (StarView Metafile) used by LibreOffice and allows transfer of the converted
image to other LibreOffice documents.

Figure 33: Convert to Polygon dialog

Conversion | 27

Converting
1) Select an image in a drawing.
2) Convert the image into a polygon using one of the following methods and open theConvert to Polygon dialog (Figure 33). There is no confirmation dialog is provided for apolygon conversion.
– Go to Shape > Convert > To Polygon on the Menu bar.
– Right-click on the image and select Convert > To Polygon from the context menu.
3) Select Number of colors and Point reduction to be used in the conversion.
4) Select Fill holes to prevent any blank areas appearing in the converted image.
5) Enter the number of pixels to use for Tile size.
6) Click Preview to check how the converted graphic will look.
7) Make any necessary changes to the settings and check the preview again.
8) If the converted image meets the expected requirements, click OK to convert the image toa polygon and close the Convert to Polygon dialog.

Breaking
After converting an image to polygons, the vectorized image can be broken into groups ofpolygons. Each group of polygons consists of one color and becomes an object that can be usedin another drawing.
1) Convert an image to polygons, see “Converting” above.
2) Make sure the converted image is selected, then use one of the following methods tobreak the image into groups of polygons:– Go to Shape > Break on the Menu bar.
– Right-click on the image and select Break from the context menu.
3) Click on a color in the image and drag the group of polygons filled with that color out of
the image to create a new image.
4) Alternatively, press Delete and delete the color from the image.

SplittingAfter converting an image to polygons and breaking the image into groups of polygons, thesepolygon groups can be split into individual polygons.
1) Convert an image to polygons, see “Converting” above.
2) Break the image into groups of polygons, see “Breaking” above.
3) Select the image, then use one of the following methods to split the groups of polygons
into individual polygons:– Go to Shape > Split on the Menu bar.
– Right-click on the image and select Shapes > Split from the context menu.
– Use the keyboard shortcut Ctrl+Alt+Shift+K (macOS ⌘+⌥+Shift+K)
4) Select an individual polygon (or several polygons) in the image and drag the polygon fromthe image to create a new image in the drawing.
5) Alternatively, press Delete to delete the selected polygon(s) from the image.

28 | Chapter 6, Editing Images

Bitmap conversion
All drawing objects placed into a LibreOffice drawing are vector graphics and these vector
graphics can be converted to a bitmap (raster graphic) in PNG format. Any transparency effects
in the original vector graphic are lost during conversion even though the PNG format used by
LibreOffice Draw supports transparencies. Use one of the following methods to convert a vector
graphic to a bitmap. There is no confirmation dialog is provided for a bitmap conversion.
• Go to Shape > Convert > To Bitmap on the Menu bar.
• Right-click on the graphic and select Convert > To Bitmap from the context menu.

Conversion | 29