Feeds:
Posts
Comments

Archive for February 12th, 2019

by Tom Nelson

The Preview app is a handy tool for viewing and working with PDF (Portable Document Format) files, as outlined in the Rocket Yard guide: macOS 101: Mark It Up with Preview.  In Part Two of the guide, we’ll look at how Preview can be used for viewing and editing images.

We’ll be using Preview’s Markup toolbar, which is usually hidden. You can use the instructions from the Mark it Up with Preview guide, linked above, to access the Markup toolbar.

While it’s not a full-featured image-editing app, Preview does have some remarkable capabilities that make it a good choice for working with images, especially when you consider it’s supplied free as part of the macOS.

Destructive Editing, Auto-Save, and Versions
Preview is one of the apps that work with the Mac’s auto-save system. This means that Preview will automatically save a document as you work on it. The practical aspect to this is that Preview will use destructive editing by automatically periodically saving the changes you make to the file you’re working on. In other words, if you want to change an image back to the way it looked earlier, chances are it’s too late. Earlier versions of the image are history.

For this reason, I highly recommend that you work on a duplicate of the image file. This can be done by after opening an image in Preview by selecting Duplicate from the File menu. Give the file a new name, then use Save from the File menu. This will ensure any changes won’t affect the original file.

Optionally, you can make use of the Revert to command in the File menu to return to a previous version of the file that existed before you made any edits. This means you will lose all of the edits you made, even the ones you might want to keep.

Remove Objects from an Image
Preview has a number of tools that allow you to select an object and copy or remove the selected object from the image. One of the problems with selecting an object is the difficulty in performing a precise selection to isolate the object from the background. Preview offers two tools to perform this task: the Selection tool, which allows you to draw a rectangle, an elliptical, a free-form lasso, or a smart lasso around the desired object, and the Instant Alpha tool, which can perform a selection based on colors of objects.

Instant Alpha: This tool has been included with the Preview app for some time. It allows you to remove an object from an image, or remove the background from around an object. Instant Alpha works by making selections based on color matching, making it an ideal tool when there’s distinct difference between the object and the background.

Using Instant Alpha, you can remove the background from around an object, such as these glasses, making it easier to copy them for later use.

The instant alpha tool can be found in the Markup toolbar. It looks like a magic wand, and is usually the second tool from the left in the Markup toolbar.

To use the Instant Alpha tool, make sure the object within the image is visible in the Preview window. You may want to use the Zoom in or Zoom out icons in the standard toolbar to better focus on the object you wish to work with.

Once everything looks right, click or tap the magic wand icon.

Place your cursor near the object above the background you wish to remove.

Click and hold the mouse or touchpad while very slowly dragging the cursor over the background.

As you drag, you’ll notice the background starts to turn pink. The more you drag, the larger the area of the background is turning pink. What is happening is, as you drag the cursor, the Instant Alpha tool adjusts the range of color it will accept as a match. This lets you select more of the background as a wider color match is used. If you select too much area, you can simply drag in the opposite direction to reduce the match range.

Once you have the background selected, stop dragging, and release the mouse or trackpad button.

The pink highlight will be replaced by a dotted selection line.

Click the Delete key on the keyboard, or select Delete from the Edit menu, to remove the selected background.

You’ll likely see a sheet appear asking if it’s OK to convert the image format to PNG. This is done to ensure the deleted areas of the image are replaced with a transparent background.

You may need to repeat the process to remove background areas near the desired object that were a different color.

Once you’ve removed the background around the object, you can use any of the Selection tool types to select the object, and then select Copy from the file menu.

The selected object will be saved to your Mac’s clipboard for use in other apps.

You can save the object to a file by selecting File, New from Clipboard.

Preview will open a new image file with the object you just copied.

You can then select Save from the file menu.

Smart Lasso: The Smart Lasso tool is part of the Selection tool’s options. It allows you to draw a freeform selection line around the object you wish to copy or delete. The smart lasso will attempt to automatically adjust the selection path based on color intensity. This allows it to conform to the object you’re attempting to select.

The Smart Lasso lets you draw around an object you want to select, and will automatically resize itself to follow the outline of the selected object. Photo © Coyote Moon, Inc.

To use the Smart Lasso, make sure the object of your desire is visible within the image. Adjust the zoom in or zoom out settings as needed.

Click or tap the chevron just to the right of the Selection tool.

In the dropdown menu that appears, make sure that Smart Lasso is chosen.

Place the cursor along one of the edges of the object, then click and hold the mouse or trackpad. Start dragging a line around the object. As you drag, you will notice the freeform line being drawn has a thick border. Make sure the edge of the object you wish to extract is within the thick border of the line you are drawing.

Finish the Smart Lasso by completely surrounding the object, and returning to the starting point.

Release the mouse or trackpad; the thick line will become a dotted selection line hugging the selected object.

Advertisements

Read Full Post »