[]
        
(Showing Draft Content)

Paint

Paint tools are a set of tools or functions used to change the area of the canvas or image by adding paint strokes or fine lines in different colors and thicknesses. DsImageViewer provides PaintToolsPlugin that adds the Paint Tools button to the toolbar. The Paint Tool button opens the secondary toolbar containing the Paint tools that allow a user to draw or paint on an image.

DsImageViewer also provides some useful tools, such as the Clone Stamp tool to copy pixels from the selected area to another area and the Select tool to select a region to either draw, copy, or cut for further use.

paint-tools-full

The following table lists the options available in the Paint Tools secondary toolbar:

Icon

Name

Description

rectangular-marquee-tool-icon

Rectangular Marquee Tool

The Rectangular Marquee tool makes square and rectangular selections.

lasso-tool-icon

Lasso Tool

The Lasso tool allows you to draw freehand selections.

elliptical-marquee-tool-icon

Elliptical Marquee Tool

The Elliptical Marquee tool makes round and elliptical selections.

polygonal-lasso-tool-icon

Polygonal Lasso Tool

The Polygonal Lasso tool allows you to draw polygonal, jagged selections.

pen-tool

Pencil

The Pencil tool draws shapes and unrestricted curves without anti-aliasing.

brush-tool

Brush

The Brush tool paints artistic strokes with fluidity and precision, simulating the qualities of a traditional paintbrush. It creates smoother lines due to blurred edges and anti-aliasing.

clone-stamp

Clone Stamp

The Clone Stamp tool copies the pixels from the selected area to another area.

eraser-tool

Eraser

The Eraser tool removes the drawing drawn by the Pencil or Brush tool when the Use Original Image toggle button is Off. It also helps remove a part of the original image when the Use Original Image toggle button is On.

paint-size

Size

The Size dropdown allows a user to choose the thickness, hardness, and opacity of the line.

color

Color

The Color dropdown allows a user to choose the color of the pencil or brush used to draw the line.

use-original-image

Use Original Image

The Use Original Image toggle button allows a user to use the original image, combined with your recent edits, as a background source for new edits. It allows you to erase both the new edits and the background when enabled and only the new edits when disabled. And it also allows you to clone a part of the original image with the new edits when enabled and only the new edits when disabled.

undo

Undo

The Undo button reverts the image to its state before the last change.

redo

Redo

The Redo button changes the image to its state after the last change.

apply

Apply

The Apply button accepts all the changes and applies to the image.

cancel

Cancel

The Cancel button discards all the changes and reverts the image to its original state.

Note: For more information on adding PaintToolsPlugin to DsImageViewer toolbar, refer to Using Plug-ins.

Refer to the following sections for more information on all the above-mentioned functionalities:

Selection Tool

DsImageViewer provides four different types of selection tools in PaintToolsPlugin, which are present in the Selection Tools button located at the secondary Paint Tools toolbar. The Selection Tools button opens a drop-down menu containing Rectangular Marquee Tool, Lasso Tool, Elliptical Marquee Tool, and Polygonal Lasso Tool. These selection tools allow a user to select a specific region in an image and use this region either to draw a desired shape or graphic inside the region or to cut or copy this region and paste it in the desired location.

Painting in Selected Region

  1. Select the desired selection tool from the Selection Tools drop-down button.

  2. Outline or select the region where you want to paint using the selection tool. This will create a mask for the selected region.

  3. Select any Paint Tool to draw or paint inside the selected region, where the paint or draw operation will be limited to the selected region.

painting-selected-region

Cut, Copy, and Paste Selected Region

  1. Select the desired tool from the Selection Tools drop-down button.

  2. Outline or select the region that you want to copy or cut.

  3. Copy or cut the selected region using the keyboard shortcuts.

    Note: You can use the following keyboard shortcuts to copy, cut, and paste:

    • Copy: Ctrl+C for Windows and Cmd+C for MacOS

    • Cut: Ctrl+X for Windows and Cmd+X for MacOS

    • Paste: Ctrl+V for Windows and Cmd+V for MacOS

  4. The selected region gets pasted in the top-left corner using the keyboard shortcut. You can then adjust the pasted region by dragging it with the mouse and placing it at your desired location.

cut-copy-paste

Draw and Paint

With DsImageViewer's Paint Tools, you can draw or paint lines on an image using the Pencil (pen-tool) or Brush (brush-tool) tools. The Pencil and Brush tools function the same; the only difference is that the Brush tool creates smoother lines due to the blurred edges and anti-aliasing.

Refer to the GIF image to draw or paint on an image using the Pencil and Brush tools:

pen-brush-tool1

Clone Stamp

The Clone Stamp (clone-stamp) tool in DsImageViewer copies pixels from one area and pastes them into another. It works the same as copying and pasting text, but you paste the content by painting it in an image. The Clone Stamp tool is most useful when you need to copy the same pixels from one area of an image to another.

To copy pixels from one area of an image to another:

  1. Select the Clone Stamp tool from the secondary toolbar.

  2. Toggle the Use Original Image button to ON.

  3. Adjust the area size and choose the source area by holding the Alt key and clicking on the area of the image you need to clone.

    Note: You need to press the Option key instead of Alt on Mac devices, and for mobile devices without keyboards, the first tap will define the source area.

  4. Position the cursor over the area where you want to apply the cloned pixels.

  5. Click and paint over the target area.

  6. Continue painting and adjusting the source area as needed.

  7. After finishing painting, release the mouse button and review the cloned effect.

clone-stamp-working


Limitations

DsImageViewer does not support editing images with animation or multi-frame images. The following is a list of uneditable image formats:

  • GIF

  • ICO

  • SVG

  • TIFF