The Eraser makes pixels transparent. It is a tool for working with layers (composites, star layers, masks, montages) rather than for a single astro image: erasing matters when there is something under the layer to show through. On a layered image it erases the active layer's mask; on a single image it erases the alpha channel, adding one at the first stroke.

Categories
  • Tools
  • Painting
  • Layers
Keywords
  • eraser
  • erase
  • transparent
  • transparency
  • alpha
  • alpha channel
  • layer
  • layer mask
  • background eraser
  • magic eraser
  • tolerance
  • contiguous
  • feather
  • composite
  • star layer
  • montage
  • checkerboard

1Introduction

A layer covers what is under it. Erasing part of it lets the layer below show there: the edge of a panel of a mosaic, the halo of a star layer over a starless image, the sky around an object pasted into another frame. The Eraser does this with a brush, as the Paintbrush paints, with the same size, softness and opacity.

It has three modes. Erase makes what the brush passes over transparent. Background erases only the sky under the brush: the stars and the nebula brighter than the sky stay, so the brush can go over them. Magic erases, with one click, an area of pixels like the one clicked: a flat sky, a black border, a frame around the picture.

On a layered image the Eraser works on the active layer's mask: white shows the layer, black hides it, so erasing paints the mask toward black. A layer with no mask gets a white one at the first stroke. On a single image the Eraser works on its alpha channel; an image with none gets one, fully opaque, at the first stroke, in the same history step as the strokes. Transparent pixels show a checkerboard in the image window. XISF, TIFF and PNG files keep the alpha channel; JPEG files cannot, and DSPX says so when it saves one.

2Quick Start

  1. Open the layered image and make the layer to erase the active one in the Layers panel.
  2. Click Eraser on the toolbar. The Tool panel shows the Eraser.
  3. Choose the Mode and set the Size, Softness and Opacity. A circle the size of the brush follows the pointer over the image.
  4. Paint over what should go: each drag is a stroke (in Magic mode, each click). Ctrl+Z takes the last stroke back, Ctrl+Y erases it again.
  5. Click Apply. The strokes become one history step of the image.

3Interface & Parameters

The Tool panel shows the tool's name and icon on its first row, then the mode, the brush, the mode's own settings, the strokes, and Apply and Cancel. Only the settings of the mode chosen are shown.

3.1The Mode

Erase: Makes what the brush paints over transparent.

Background: Erases only the background under the brush. The background's level is the median of the pixels under the brush: a star or a filament covers a small part of a brush on the sky, so the median is the sky's level even when the brush is centered on a star. A pixel within the tolerance of that level, or darker, is erased; a pixel brighter than the level by more than the tolerance stays.

Magic: A click erases the area of pixels similar to the one clicked (the mean of it and its eight neighbors): pixels whose every channel is within the tolerance of it.

3.2The Brush

Size: The brush's radius, in pixels of the image, from 1 to 500. Ctrl and the mouse wheel over the image change it.

Softness: How the brush fades from its center: 0 is a hard edge, 1 a brush that fades from the center.

Opacity: How much a stroke erases: 1 makes the pixels fully transparent, 0.5 half. Within one stroke a pixel is erased once, by the strongest part of the brush that passed over it; a second stroke erases more.

3.3Background and Magic

Tolerance: How far from the sampled level a pixel may be and still be erased, from 0 to 1. It is measured on the image as the screen shows it, through its screen stretch, so the same tolerance works on a linear image and on a stretched one.

Sample (Background): Once takes the background's level where the stroke starts; Continuous takes it again as the brush moves, for a background that changes along the stroke.

Protect brighter (Background): On, what is brighter than the background by more than the tolerance stays (stars, nebulae). Off, only pixels near the background's level are erased: much darker ones stay too.

Contiguous (Magic): On, only the connected area around the click is erased. Off, every similar pixel of the image is.

Feather (Magic): Softens the edge of the erased area, in pixels.

3.4The Strokes

A line says how many strokes the session has. The row of buttons below it works on them, as the Paintbrush's: delete the last stroke for good, undo all, undo one (Ctrl+Z), redo one (Ctrl+Y), redo all. Delete over the image deletes the last stroke. The handle at the right of the line drags the Eraser's settings onto a LaunchPad, as a button that sets them.

3.5Apply and Cancel

Apply: Ends the session with its strokes in the image: one history step. Edit > Undo then takes all of them back at once, and the alpha channel the first stroke added.

Cancel: Ends the session with the image as it was when it began, to the last bit.

4Erasing

4.1The Session

The first stroke on an image starts the Eraser's session on it. While the session is open the tool holds the image: it cannot be closed, processed, saved or undone from the History panel, and DSPX says so. Over that image, Ctrl+Z and Ctrl+Y are the tool's, one stroke at a time.

4.2Layers

On a layered image the first stroke makes the active layer's mask the target (a white mask is added first when the layer has none, as its own history step; a mask that is off is turned on). Erasing then paints the mask toward black, or toward white when the layer's mask is inverted. The levels of the Background and Magic modes are the layer's own pixels.

4.3The Selection and the Mask

Only what is selected is erased, and nothing is erased where the image's mask is black; where it is gray, the stroke erases in proportion.

5Usage Tips and Tricks

Star layers. Over a starless image, a star layer with the Background mode and a large brush loses its sky and keeps its stars. Start with a small tolerance and raise it until the sky goes.

Mosaic edges. A soft brush at a low opacity, passed along the edge of a panel a few times, blends it into the panel below without a seam.

Borders. The Magic mode with Contiguous on removes a black border or a flat frame with one click; a small feather keeps its edge from looking cut.

A single image. Erasing a single image only makes sense if it will be put over something else later (saved as PNG, TIFF or XISF with its alpha channel, and used as a layer elsewhere).

Paintbrush: paints, blends, blurs and smudges with a brush, with the same session and undo; with its black ink it paints a layer's mask by hand.

Selection: selects an area by hand, to keep the eraser inside it.

Create Alpha Channels and Extract Alpha Channels: make an alpha channel from an image, and an image from an alpha channel.