Here’s a few simple steps to achieve a background knockout on an image in which the background is a solid color.
Photoshop offers plenty of ways to achieve this same affect through various Toolbar tools and Layer Masking techniques. Each technique is most advantageous depending on the complexity of surrounding pixels separating the target knockout object and the background. (Primary examples include use of and combinations of ‘Extract Filter’, ‘Selection Tools’, ‘Pen Tool’, ‘Layer, Vector, Quick & Alpha Channel Masks.)
But for the sake of a quick solution and a no fuss alternative to applying options bar settings per tool, there is a handy technique directly within the ‘Blending Options’.
Follow along, and I’ll show you how. (Download original chair.psd file here.)
Below, is the target image I scanned in from a magazine. The idea is to knockout the white background and separate the chair unto its own layer for further use in your design or graphic work.
- So begin by opening the image, rename the original scan layer to a user friendly name. (I named it ‘Chair’. Also duplicate it for backup purposes. Which should default to the name of ‘Chair copy’.) and hide the background layer, as I have captured below.
- Next with, the ‘Chair’ layer active, right-click (Mac: Control click) and choose ‘Blending Options’ from the context menu commands, as I have captured below.
- Next, at the ‘Blending Options’ control panel, move down towards the ‘BlendIf’ ‘This Layer’ option, and adjust the far right upward arrow control slider to the left. Keep nudging(by dragging it) it until you can see that the white background in the canvas view disappears.
In this particular case I dragged the white slider to a value of 225. Which basically means that brightness values higher than 225 will remain unblended and will be excluded from the final image.Note: The blended pixels is measured on a scale from 0 (black) to 255 (white). The Blend If ‘Gray’ option specifies a blending range for all the channels. (In this case its an RGB image, so that corresponds to all the pixel information for each of the ‘Red, Green & Blue’ channels.)Click OK to commit the changes of the Blendings Options panel. Below is the result.
Thats basically it. Just another way to knockout a solid color. Handy for scanned images.
Soften the transition of the Blend If Effect:
If your background area contains variations in color/texture or the above method creates a fringe halo to the edge of the target object (this case the chair). Then you can further control the blend range by softening the transition.
Simply, hold down the ‘Alt’ key + click (Mac: Option key + click) on the arrow slider, to break it into halfs. As I have captured below. Notice the slider control is now diveded in two and the pixel rage to adjust the blending is now bewteen those two areas. This case 215/225. (Encircled in red)
What are the visible clues after using the Blend If Effect?
Also, if you use this method, it can be difficult to tell if a layer has this ‘Blend If’ feature in use. Becuase, unlike the other ‘Blending Options’ parameters it leaves no visible nested Layer Style attached to the layer.(Ie, Stroke, Bevel & Emboss, etc.)
So as an option, Color Code the active layer by going to the ‘Layers Palette’ menu command to the upper right, choose ‘Layer Properties’ from the list, and select a Color to Color Code the layer that contains the hidden ‘Blend If’ feature. (Ie, I used ‘Red’, as I have captured below)
There is a visible clue that such a Blend Option exists, even though there is no apparent visible nested layer style (Ie. Stroke, Bevel & Emboss, etc.), but when you right + click on the Layer and from the context menu options you will see two options : namely ‘Copy Layer Style’ & ‘Clear Layer Style’. (As captured below)
Also returning to the Layer ‘Blending Options’ panel keeps intact the ‘Blend If’ options set earlier. Yet, still hidden from the Layers Palette, so I recommend to color code that layer as a visible reminder.
How can apply further Layer Styles after using the Blend If effect?
After using this simple ‘Blend If’ knockout effect, you will proably realize that using any other of the ‘Layer Styles’ still only applies to the document as if the knockout has never occurred. As captured below, I tried applying an ‘Inner Shadow’, to the chair object but it was applied to the entire document boundary.
What you see in the Layers Palette thumbnail view and what you see in the document view, don’t quite corelate either! As captured below, the thumbnail view still shows the white background, while the document view reveals transparency , as achieved through the Blend If option.
So what the heck is going on? The truth lies in the ‘Channels Palette’. Click the Channels tab and you should see the same result as below. This is the REAL visible clue to bear in mind when using ‘Blend If’.
Now it makes sense. Its really quite a sophisticated mixture of applying Layers style effects directly to the Layer through Stroke, Bevel & Emboss and so for and a ‘Blend If’ option to apply to the channels all in one Blending Options panel.
The moral of this end note is the ‘Blend If’ effect applies to the channels, and as mentioned above selecting the ‘Gray’ option applies to all the channels. The moment the high and low sliders are adjusted for either ‘This Layer’ or ‘Underlying Layer’ its effecting channel pixel information not the layer pixel information. Hense thats why applying any other layer style didn’t go directly to the ‘Chair’ object.
So how do you combine Layer Styles (Stroke, Bevel & Emboss…) & Channel (Blend If) options onto a single layer?
Here is a quick solution: Cancel out of any attempted further Layer Style. Go back to the ‘Layers Palette’, and create a new empty Layer, by hitting the ‘Create A New Layer’ icon on the bottom of the ‘Layers Palette’ or Shift + Ctrl + N (Mac: Shift + Command + N) and place it directly above the ‘Chair’ layer as I have captured below.
Then with that new ‘Layer 1’ active (hightlighted in blue in the above screen capture), hit the ‘Ctrl + E’ (Mac: Command + E) keys to merge the actively selected layer (Layer 1) with the one below it. (‘Chair’ layer)
As captured above, with the merge process, the ‘Chair’ layer now has the transparency, and still has the ‘Blend If’ option intact, whereby you can combine further layer styles to the chair object only.
Another powerful selection tool is the Quick Mask. It’s on the main ‘Toolbar’ as I have captured below. Set the ‘Foreground/Background’ color to ‘Black/White’ (D key) and then hit the ‘Quick Mask’ button to enable it.
Also note the color of the active layer when in ‘Quick Mask’ mode. (A light grey)
Then carefully paint your mask area with the ‘Brush/Pencil Tool’. (May require you to zoom in) The mask color should appear red as I have captured below.
Then switch back to ‘Standard Mode (Q)’ as I have captured and you should see your selection.
If your selection is not perfect, turn the ‘Quick Mask Mode’ button back on, then switch the ‘Foreground’ color to ‘White’ and paint to eliminate unwanted ares in your mask.
Now that your selection is made, ‘Add Layer Mask’ by selecting the icon in the ‘Layers Palette’ as I have captured below.
This is what your image should look like.
- The selection is saved as a new channel in the ‘Channels Tab’ of the Palette. of the palette.
- Imperfections become much more visible in the channel mask to allow for further cleanup.
This method is a straight forward method and involves the ‘Background Eraser Tool (E)’ . This tool finds the edges of an object but instead of selecting the object, they remove pixels outside of it. This tool works best when theres more than one color in the background to be removed.
With this tool active, activates some further ‘Options Bar’ features for this tool.
The important thing to note here is the position of the ‘Cross Hair’. Keep it outside the edge of the areas you want to protect and only in the background area. As you see below, with the above ‘Options Bar’ settings, a single click and drag of the ‘Background Eraser Tool’, I’m able to make a clean erase along the edge of the building. (Your image will require a variation on the ‘Tolerance’ option.)
The ‘Sampling – Once’ option sets the ‘Background Color’ map and tells the Brush what to erase.
Alternatively, instead of click and drag method, draw a rough line (from left to right) with the (‘Paths’ ) ‘Pen Tool (P)’ , as I have captured below.
Then with the ‘Direct Selection Tool (A)’ active, right-click (Mac: Command + click) and choose ‘Stroke Path’.
Then from the ‘Tool’ list choose the ‘Background Eraser (E)’ then hit OK.
Based on your, ‘Background Eraser’ Option Bar settings (I used the same as above), it should make a clean erase along the path. Then with the normal ‘Eraser Tool (E)’ simply erase away the remaining unwanted background areas.
- Continuous: Sampling is based on any color range that falls under the cross hair. (Watch the Background Swatch color change as you move around with this tool
- Once: Single click on the background will tell the Eraser tool the sample color to eliminate.
- Background Swatch: Erase only areas containing the current background color.
- Anti-aliased: This keeps a smooth transition between erased and non-erased parts.
- Tolerance: Defines the range of similar colors that can be erased.
First select the ‘Pen Tool (P)’ from the ‘Toolbar’.
Then up on the ‘Options Bar’ choose the ‘Paths’ option.
Then with the ‘Pen Tool’ still selected trace the area that you want to mask (ie. protect), in this case its the entire building. As you can see below the solid pen outline and the solid anchors points are traced along the edged of the building.
Once you’ve connected the anchor points to create a path, go to ‘Layer/Add Vector Mask/Current Path’ as I have captured below.
Or alternatively, right-click (Mac: Command + click) and choose ‘Create Vector Mask’ as I have captured below.
This will protect whats inside the path and knockout whats external to that path, as you can see below.
- Go to the ‘Paths Palette’ and you will see that saved path in the list,
- the ‘Vector Mask’ remains separate from the original image as indicated by the adjacent ‘Vector Thumbnail’ in the ‘Layers Palette’.
- The mask is adjustable, meaning using any of the ‘Path Selection Tool’ / ‘Direct Selection Tools (A)’ and or the ‘Pen Tool (P)’ and subsequent sub tools to modify all ‘Anchor Points’ or any single ‘Anchor Point’.
- ‘Adjustment Layers’ and ‘Filters’ can also be applied.
- ‘Layer Masks’ and ‘Blending Styles’ can also be applied.
- Right-click (Mac: Command + click) on the ‘Vector Mask Thumbnail’ in the ‘Layers Palette’ allows to ‘Delete/Disable/Rasterize Vector Mask’.
(Also found under the ‘Layer’ menu item.
- ‘Rasterize Vector Mask’ turns it into a ‘Layer Mask’ enabling the Paint Brush Tool to ‘Hide/Reveal’ sections of your mask. (Black = Hides/ White = Reveals) But then you loose the ‘Pen Tool’ option that is only available with the ‘Vector Mask’)
- Combine a ‘Layer Mask’ with a ‘Vector Mask’ will enable both the ‘Brush/Pencil Tool’ and ‘Pen Tool (P)’ features.
- To automatically start with a ‘Vector Mask’ in the ‘Layers Palette’ hold the ‘Ctrl’ (Mac ‘Command’) key as you click the ‘Add Layer Mask’ icon at the bottom of the ‘Layers Palette’. Then use the ‘Pen Tool’ to mask the required area.
- ‘Vector Mask’ also enables the use of the ‘Shape Tools (U)’ and its ‘Option Bar’ features.
Here’s a few simple steps to achieve another method of eliminating the background of an image when exporting the image to a page layout, vector-editing application, or printing purposes.
We will create a ‘Clipping Path’ to isolate the nontransparent portion of an image so that layout programs print the image as expected, otherwise, it will display and print the transparent portions of an image as white.
Below is the working image, and the goal is to separate the cup from the rest of the image.
- Start with the ‘Pen Tool (P)’ (with ‘Path’ Options Bar feature active) (or any other Selection Tool) on the Toolbar and trace around the outer edge of the cup, until you have a complete path. (As I have captured below) To adjust the curve of the Path use the ‘Convert Anchor Point Tool’ (Hidden under the Pen Tool on the Toolbar)This image will require two paths, one on the outer edge and one for inside the cup handle.The ‘Outer Path’ was first created using the above mentioned tools. To continue with the ‘Inner Path’, as a separate path, make sure all other segments are closed. (IE. as the Outer Path is closed by connecting the first and last Anchor Points)) Then with the same active tools create another closed path for the ‘Inner Path’.
Your ‘Paths’ palette should have a single Path Layer. (As captured in step 3)
Side Note: If you step away from after creating the initial ‘Outer Path’ and move on to other tools, chances are you will end up with separate ‘Path’ layers as I have captured below.
To get the mistaken separate outer path back into the original, simply Select it, in the ‘Paths Palette’ as I have captured above (Entitled ‘Work Path’, and highlighted in blue – meaning its the active layer).
Then ‘Ctrl + C’ to copy the path to the clipboard. Select/activate the original ‘Cup’ Path, then ‘Ctrl + V’ to Paste. You should then have like the below capture.
Then delete the stray ‘Work Path’. Repeat the copy, paste and delete process of other stray segments.
Ultimately, to prevent from creating stray path segments, keep the Paths Palette visible, instead of the Layers Palette, and keep the current path active. (Highlighted in blue)
- Next, go to the ‘Paths Tab’ thats docked into your ‘Layers Palette’, and notice the clipping path (with default name of Work Path) in the ‘Path Thumbnail Preview’.Note: If the Paths Tab is not visible, go to ‘Window/Paths’ menu command.
Note: If you use another ‘Selection Tool’ then the default ‘Work Path’ will not be visible until you select the ‘Make Work Path’ icon (4th from right) on the bottom of the Paths Palette. (Then proceed below)
- Next, double click that clipping path (one with default name of Work Path) in the ‘Path Thumbnail Preview’ and the following dialog should appear. Give the ‘Work Path’ a friendly name as I did (‘Cup’) and choose OK to complete saving of the path.
- From the ‘Palette Options Menu’ button list, choose ‘Clipping Path’ as I have captured below.As you can see in the thumbnail preview, the path defines the cup area of the image to show when we need to place it another program or for print.
- Next, choose the ‘Cup’ work path from the ‘Path’ drop down list, and leave the ‘Flatness’ empty. Then ‘OK’ to complete create ‘Clipping Path’ process.
- The Clipping Path is created, so Save your file as a .psd as you normally would to save an original document. Then in any other Adobe Program that has the ‘File/Place’ command, (in my first example below I used Adobe Illustrator), as captured below…Below, are just some other possible uses for this Adobe Photoshop Clipping Path option. (Picking up where step 7 left us)
Integration with Adobe Illustrator:
Open Adobe Illustrator, and have a new document ready, then go to ‘File/Place’ command option then at the prompt and choose the ‘Flatten Layers’ option.
As captured below, the original .psd clipping path is visible and the cup remains without the background. (Inside Adobe Illustrator screen shot)
Integration with Adobe Illustrator:
Another use for this Clipping Path, is that when Printed inside Adobe Illustrator (‘File/Print (P)’), the Clipping Path remains as it keeps the Cup object separated from the background, as our original intention. The below screen capture shows a snippet of the Print dialog box.
Still inside Adobe Illustrator, I can add additional objects (best kept on there own layers) and filter affects (such as Drop Shadow), as I have captured below, and the Photoshop Clipping Path still retains the transparency effect.
Integration with Adobe Acrobat:
Still inside Adobe Illustrator, you can save this document with the Photoshop Clipping Path, as a .pdf (‘File/ Save As/ and choose .pdf from the list options.
From the ‘Adobe PDF Options’ dialog, I set the features as captured below (some options here are for CS versions only).
Adobe Acrobat automatically opens (cause I set it in the above options), and still the Photoshop Clipping Path remains. And even better, with the new CS Suite, theres a new option to write and preserve layers (as you can see on the below, left) . Great possibilities and even greater flexibility for object placement.
As within Adobe Illustrator, Acrobat printing also preserves the original Photoshop Clipping Path, as I have captured below.
Integration with Adobe Indesign:
Like in Adobe Illustrator, we ‘Place’ the original clipping path cup .psd file through ‘File/Place’ Indesign command option (in a New Document). Again, the Photoshop Clipping Path still remains, and lots of room for flexibility of that .psd object. (Like Drop Shadows – and much more, as I have captured below)
Integration with Other Programs:
If you are using a page layout program that cannot place .psd files as I demonstrated above, then choose ‘File/Save As’ within Adobe Photoshop and choose ‘Tiff’ file format for printing to non-PostScript printers or ‘EPS, DCS, or PDF’ file format for printing to Postscript printers.
Note: If you deleted the background around the image in the Photoshop .psd file, you still have to define the area with a clipping path before converting the file to TIFF or EPS.
[message type=”info”]Note: The Extract Tool is not available for Photoshop CS5[/message]
Select the target layer in the Layers Palette and choose’ Alt+Ctrl+X’ (Mac: Option+Command+X)(‘Filter/Extract’) to open the ‘Extract Filter Tool’.
Using the default settings, except for brush size, I simply selected the ‘Edge Highlighter Tool (B)’ and painted along the edge of the building from left to right. When complete, select the ‘Fill Tool (G) and click once inside the boundary of the highlight edge to protect it and the remaining areas will be knocked out.
- Shortcut keys work in this panel.
- So Ctrl + Plus (Mac: Command + Plus) key to zoom in
- [ key decreases the size of the brush / ] key increase the size of the brush
- Use a small brush size.
- Do not paint to far inside the area you want extracted, otherwise some edges will appear sketchy.
- If your highlight lines are too thick, hold down the ‘Alt’ (Mac: Option) key to erase unwanted transition areas.
- ‘Alt+Backspace’ (Mac: Option + Delete) to delete the entire edge highlight and start over.
- Switch between the Original and Extracted views before clicking the Ok.
View the ‘Extract’ screen shot.Here’s the final result. I added a background color layer for contrast.