Tutorial — Removing Image Backgrounds With Fireworks 8

Introduction

This Quick Tutorial will teach you the most effi­cient method for “remov­ing” back­grounds from images quickly and eas­ily using Macromedia Fireworks 8. This is one of the most fre­quently asked ques­tion on Macromedia’s and other Fireworks related pub­lic forums and the typ­i­cal answers that are pro­vided often describe meth­ods that are less than ideal because they are based on old, inef­fi­cient tech­niques learned in pure raster image edit­ing appli­ca­tions like Photoshop.

Fireworks has bet­ter and more flex­i­ble ways to per­form this com­mon task that yield bet­ter look­ing results as well as being non-​destructive which means that edit­ing the result at a later date is not only pos­si­ble but straight­for­ward. With the release of Fireworks 8, users now have access to new func­tion­al­ity that makes this com­mon task eas­ier than ever before by com­bin­ing the strength of Fireworks’ vec­tor and bitmap tools. It works best on images that have plain, even back­grounds but the tech­niques learned here will help you deal with this task on any type of image.

As this is a Quick Tutorial, the expla­na­tions will move along pretty fast as I assume that you have at least a basic knowl­edge of image edit­ing in gen­eral and of using Fireworks in par­tic­u­lar. I won’t stop to explain all that each tool can do and how they work in detail but see­ing how they are used to per­form the fol­low­ing tasks will give you much more insight than dry expla­na­tions ever could. I also pro­vide illus­tra­tions that will make things very clear. I have also pro­vided files that you can use to work through this tuto­r­ial and fol­low along each step. One file is the start file and only con­tains the ring image. The sec­ond one is a com­pleted file that con­tains not only the final image, but also lay­ers which illus­trate each step of the tuto­r­ial. Just turn on each layer in turn to see how your work should look like at each step. You can down­load the files here:

Tutorial assets (Zip archive, 411Kb)

Removing A Plain Background The Old Fashioned Way

Fig. 1: Original dia­mond ring image
on a white background.

Before we start look­ing at how to accom­plish this task in Fireworks 8, let’s look at how this was tra­di­tion­ally done first. Comparing the two meth­ods and their results will clearly demon­strate the advan­tages of doing it the Fireworks way.

The image we’ll work with in this tuto­r­ial is the eas­i­est type of image you’ll have to deal with when per­form­ing this kind of task because it has a plain and even back­ground of a sin­gle color (see Figure 1). Traditionally, you would use the Magic Wand tool to select the back­ground around the image and delete it. You would then select the back­ground inside the ring and delete it as well.

There are two prob­lems with this com­monly used approach. The first one is that it is destruc­tive and irre­versible. You can­not mod­ify the remain­ing object’s con­tour after remov­ing the back­ground and if you are not sat­is­fied with the result you would need to start from scratch. With this dia­mond ring image that wouldn’t be much of a has­sle because you are only redo­ing 4 sim­ple oper­a­tions but if your image back­ground was more com­plex it could become a tedious task to redo all the selec­tions on a fresh copy of the image in order to delete its background.

Magic Wand tool toleranceFig. 2: Top: Wand tol­er­ance set to 2.
Bottom: Wand tol­er­ance set to 4.

The sec­ond prob­lem is that, no mat­ter how care­fully you make your selec­tion, pix­els with the color of the old back­ground will prob­a­bly stay behind on the con­tour of the image and will show when you place the image over a new back­ground (which is usu­ally the goal of the whole exer­cise to begin with). You could increase the Magic Wand tool’s Tolerance set­ting to elim­i­nate more or all of the old background’s pix­els but in any case, the edge of the image will be jagged. Look at Figure 2 to see an exam­ple of remov­ing the back­ground on the dia­mond ring image and then plac­ing that image on a black background.

In the top image of Figure 2, the Magic Wand tol­er­ance was set to 2. Notice the unsightly white pix­els that were left behind. Not good. In the bot­tom image, the tool’s Tolerance was set to 4 and the white pix­els are pretty much gone but see how jagged the contour’s edge is. In both cases the Magic Wand’s Edge set­ting was set to Anti-​Alias so the jagged edge is not due to a selec­tion with a hard edge. Using feath­er­ing would only mar­gin­ally improve the result in that it would alle­vi­ate the jag­gi­ness prob­lem but we would loose the edge sharp­ness that we had when the ring appeared over its orig­i­nal white back­ground and the result would look fuzzy and unnatural.

In Fireworks, a workaround that is some­times rec­om­mended to try and min­i­mize the jag­gi­ness of an image’s edge after remov­ing its back­ground the way I described above is to apply a glow effect to the result­ing image with a Width of 2, Opacity of 100% , Softness of 1 and with the color of the new back­ground. To my eye it still doesn’t look good enough when the new back­ground color is dif­fer­ent enough from the orig­i­nal and if you switch to yet another back­ground color you have to mod­ify the glow’s color as well… tedious and annoying.

There is a bet­ter way that will avoid any jagged edges, pre­serve the sharp­ness of the con­tour and anti-​alias it to any back­ground color you choose with­out requir­ing any addi­tional work on your part. Welcome to the Fireworks 8 way.

Removing A Plain Background the Fireworks 8 Way

Now that you have seen the old fash­ioned way of remov­ing a plain back­ground, you will learn how to do it more effi­ciently in Fireworks 8 by using its unique blend of bitmap and vec­tor tools. Start by open­ing both the start­ing and final PNG files you down­loaded before. The start file already con­tains the same dia­mond ring image you saw in Figure 1 which you will be using to per­form the steps in this tuto­r­ial. So let’s begin!

Magic Wand tool background selectionFig. 3: The entire back­ground is selected.

Step 1: Select the Magic Wand tool and, in the Property Inspector, give it a Tolerance value of 4 and set the Edge to Anti-​Alias. Then click in the mid­dle of the ring to select the hole inside. Next, press and hold the Shift key with the Magic Wand still active and click out­side the ring to add the back­ground around it to the selec­tion. You should end up with some­thing that looks like Figure 3. You can also look at the “Step 1 & 2” layer in the final PNG file and select the dia­mond image. I have saved both the inside and out­side of ring selec­tions as well as the com­plete one and you can recall any one of them by going to the Select menu and choos­ing “Restore Bitmap Selection”. You need to have the ring image selected with the black arrow tool in order for that menu item to be active.

Ring seletedFig. 4: Only the ring is selected after
the back­ground selec­tion was inverted.

Step: 2: Here is where the steps start to dif­fer from the old style method I described before. Traditionally, you would delete the image’s back­ground at this point but here, we will achieve the same result by apply­ing a vec­tor mask that reveals only the ring image instead. In order to do that, we’ll need to mod­ify the selec­tion we have now since we want it to cover the actual ring and NOT the back­ground around it as it does now. This is a sim­ple one step process. With your bitmap selec­tion still active (as in Figure 3), go to the Select menu and click “Select Inverse”. The bitmap selec­tion now cov­ers the ring instead of the back­ground of the image. To see how this should look like, take a look at Figure 4 or, in the final PNG file, select the ring image in the “Step 1 & 2” layer and go to the Select menu to restore the “Ring Only” saved bitmap selection.

From bitmap selection to vector shapeFig. 5: Resulting vec­tor shape still selected
after bitmap selec­tion conversion.

Step 3: Next we’ll use the new Fireworks 8 fea­ture that makes all of this pos­si­ble. With your ring selec­tion still active, open the Select menu again and click “Convert Marquee To Path”. Our bitmap selec­tion has just been trans­formed into a vec­tor shape that fol­lows the selection’s con­tour and has the default Stroke and Fill set­tings that were selected in the main tool­box. In my case there was no stroke set and I got a solid red fill and the result looked like Figure 5. That red fill will need to be changed to a white one in order to be used as a mask that will “remove” the ring’s back­ground but, in the Additional Notes and Tips sec­tion at the end, I’ll show you how that red fill can be use­ful (if you lower the shape’s opac­ity) to cre­ate what’s often called a “ruby mask”. For now let’s move on with our mask­ing task.

Step 4: Leave the vec­tor shape selected or select it again if you need to and remove the stroke in the Property Inspector if your shape has one then change its fill to a solid white fill.

Note: If you des­e­lect the vec­tor shape now, you should see a barely vis­i­ble dark out­line around it which is the only part of the ring that our mask will not cover (see the “Step 4” layer in the final PNG file).

Fig. 6: The ring after apply­ing the vec­tor mask.

Step 5: We’re now ready to apply the mask to the ring image. Switch to the Black Arrow tool and click any­where in the gray area out­side the can­vas to des­e­lect every­thing. Then, shift click on both the ring image (click on its back­ground out­side the white vec­tor shape) and on the vec­tor mask shape itself so that both are selected and finally go to the Modify menu and click on “Mask” then on “Group As Mask”. Your work should now look like Figure 6.

Editing the Mask

Notice how much cleaner the edges look in Figure 6 com­pared to both images in Figure 2. The back­ground in the start­ing PNG image you down­loaded at the begin­ning of this tuto­r­ial was black but you didn’t see it because the bitmap image’s back­ground cov­ered it. The PNG file’s black back­ground was revealed when you per­formed the “Group As Mask” step above. We can change that back­ground color at will now and Fireworks will always cor­rectly anti-​alias the edges of the masked ring to any back­ground color you choose automatically.

To visu­al­ize this, go to the Property Inspector now and choose dif­fer­ent back­ground col­ors to see how the edge of our ring will look against them. You’ll see that the edge of the ring does get anti-​aliased cor­rectly to each new back­ground color which was def­i­nitely not the case with the result­ing image you got with the old fash­ioned method. The dif­fer­ence in the qual­ity of the results between both meth­ods is quite sig­nif­i­cant as well and, with vec­tor masks such as this one, the process is never irre­versible and the mask remains editable at all times. Since no pix­els in the ring image ever got deleted we can still tweak the vec­tor shape and try to get bet­ter results.

Mask problem areasFig. 7: The high­li­ighted areas need some work.

Look at Figure 7 to see the two areas I have cir­cled in red and which I think should be tweaked. If you zoom closer to the image you’ll clearly see why they need to be edited. Look at the “Areas that need edit­ing” layer in the final PNG file and zoom to about 400%. On the left, notice how the orig­i­nal selec­tion did not closely fol­low the inside curve of the ring. The prob­lem is even more obvi­ous in the right area where the point doesn’t go far enough to the right and the curve at the bot­tom doesn’t closely fol­low the curve of the ring leav­ing a “strip” of white that looks out of place against our con­trast­ing black back­ground. Moving the right­most anchor one pixel to the right and edit­ing its curve han­dles cured the prob­lem quickly. A lit­tle tweak­ing of the posi­tion and han­dles of the anchors in the left area also fixed the curve in no time.

Tweaked maskFig. 8: Final result after tweak­ing the mask shape.

In Figure 8 you can see the results of my final tweaks and how they improved the edge of the image in those areas. If you’d want to be more picky, you could also edit the vec­tor mask path around the dia­mond itself where the mask has left a few white areas. It looks pretty good as it is but you could always edit it by hid­ing or reveal­ing parts of the under­ly­ing image until you are sat­is­fied. This is some­thing that is sim­ply not pos­si­ble when using the old fash­ioned method as the pix­els that are gone are gone for good and the only thing you could do is remove more pixels.

Additional Notes & Tips

Building On The Technique

There are many meth­ods you can use to cre­ate a vec­tor mask. The one shown in this tuto­r­ial is effec­tive because it avoids the need to draw com­plex shapes with the Pen tool which would have been the only way to cre­ate a mask for this image in prior ver­sions of Fireworks. It will only be as easy as it’s been here when you work with images with equally sim­ple backgrounds.

But how would you go about remov­ing more com­plex back­grounds. A lot of times, you would use a tech­nique that is sim­i­lar to the one we used here but you would build your selec­tion by adding up smaller areas. With our ring image we were lucky that this was a sim­ple two clicks process, one click inside the ring and a Shift-​Click out­side the ring to add that area to the inside of ring selec­tion. It won’t always be this easy and you may have to use a mix of the var­i­ous bitmap selec­tion tools and you may have to resort to fin­ish­ing the mask shape with the Pen tool. One trick you can use to exper­i­ment freely or spread the task between mul­ti­ple edit­ing ses­sions is the “Save Bitmap” fea­ture I have used to demon­strate how the sec­tions you made should look. You can save any bitmap selec­tions you need and restore them at any time to con­tinue work­ing. A saved selec­tion will still be avail­able after you trans­form it to a vec­tor shape so use them freely.

With some images it may help not to think of the process as remov­ing the back­ground but instead as “lift­ing” up the object from the larger image. The object you want to keep may have more areas of sim­i­lar col­ors than the back­ground and you may try to select it directly.

Another thing you can do is to mix var­i­ous vec­tor shapes you obtained from select­ing parts of the back­ground or the object you want to “lift” from the image and join or punch them as needed. Just remem­ber that the final mask shape should cover the object you want to keep. In order to see bet­ter how your vec­tor mask shape cov­ers the under­ly­ing image, use the tech­nique I describe next.

Ruby Mask

The Ruby Mask tech­nique is derived from the Photoshop “Quick Mask” fea­ture which lets you “paint” a bitmap selec­tion directly on the can­vas using Photoshop’s paint tools instead of its usual bitmap selec­tion tools. When Photoshop is in “Quick Mask” mode, the selec­tion you paint in does not look like the usual “march­ing ants” you get with reg­u­lar bitmap selec­tion tools. Instead, Photoshop draws your paint strokes as a translu­cent red film over the under­ly­ing image. The name “Ruby Mask” is derived from the real life rubylith films used in the print­ing world.

How it becomes use­ful in Fireworks is that, as you work on, draw or edit your vec­tor mask shape, you can set its fill color to red and change the object’s Blend mode to Overlay. In Fireworks ver­sions prior to ver­sion 8, you could sim­ply lower the object’s opac­ity to a value of around 40%. After you have done either, you can tweak the vec­tor shape’s con­tour and see where its edge is in rela­tion to the masked object’s edge in the under­ly­ing image. It works really well and let you see clearly how well your edits improve the vec­tor mask shape.

Ruby maskFig. 9: Close-​up of our vec­tor mask shape as a
Ruby Mask on top of the diamond.

If you look in the “Ruby Mask” layer in the final PNG image you down­loaded, you’ll clearly see how closely the vec­tor shape that resulted from con­vert­ing the bitmap selec­tion really fol­lows the ring image’s edges. Figure 9 also clearly illus­trates the con­cept as I zoomed close to the dia­mond itself (400%) and you can see clearly where the Magic Wand tool didn’t select the diamond’s con­tour cor­rectly. It is almost per­fect in places and not so good in oth­ers but if you edit the vec­tor path now you’ll be able to see the under­ly­ing image and make much more pre­cise edits. This is a very use­ful tech­nique that I use all the time myself. Using it will dra­mat­i­cally improve your vec­tor mask­ing work as well.

In Conclusion

As you can see, cre­at­ing com­plex vec­tor masks is eas­ier than ever with the new fea­tures in Fireworks 8. While the tech­nique described here won’t help you in every sit­u­a­tion, it should make you mask­ing work a lot eas­ier for many images. When you mix in this tech­nique with Fireworks’ other sophis­ti­cated vec­tor draw­ing and edit­ing tools, you should be able to remove the back­ground or “lift” objects from any image.

I hope that this tuto­r­ial will be use­ful to you and that you learned some new things. If you have any ques­tions ques­tions about it or mask­ing in gen­eral, you can either con­tact me directly or post a com­ment to the pixel log blog entry where I announced the pub­li­ca­tion of this tuto­r­ial. You can also post ques­tions in the Fireworks forum on Macromedia’s Adobe’s site. I read the forum every­day and will try to reply as soon as I can. I no longer visit the Adobe users form with any reg­u­lar­ity and go there only rarely now. I’m much more eas­ily reached on Twitter (@pixelyzed) or via email.

P.S.

I’ll be adding a print­able PDF ver­sion of this tuto­r­ial to the assets file down­load at some point. I’ll do it for any future tuto­r­ial I pub­lish as well.