Jan. 17, 2008, 9:48 a.m.
posted by daemonhell
Working with PixelsWhile major pixel pushing is reserved for other applications, such as Photoshop or Fireworks, Flash still offers a few ways to edit bitmaps to creative effect. Breaking Apart a BitmapIn one way, breaking apart a Flash asset is equivalent to sending it one rung down the Flash evolutionary ladder. Depending on how you created your assets, a symbol can be broken into a group, which can be broken into a shape. The same is true of text: a word can be broken into letters, which can then be broken into shapes. Note: If you haven't already read about the Modify Break Apart command in Chapter 1, you may want to do so now.In the case of bitmaps, breaking them apart lets you work with them in nontraditional ways. For example, you can select a portion with the Selection or Lasso tool and remove it, or you can use the Bush tool and paint a new color into it. These are behaviors commonly associated with shapes, but a bitmap that has been broken apart doesn't exactly behave like a shape. For instance, if you click a color hoping to select it, you will find that the entire bitmap is selected. This is because the bitmap is still behaving as if it were intact, as though you simply modified the container in which it resides. This can be demonstrated using the bitmap_break_apart.fla file in the /05/Working with Pixels folder, as shown in Figure. After breaking apart the bitmap, step 1 shows the upper-right corner of the bitmap selected by the Selection tool. Step 2 shows that selection deleted, seemingly removing that portion of the bitmap. Step 3 shows the lower-right corner being moved like a traditional shape. Finally, step 4 reveals that the bitmap is still seen in the previously deleted area. What's more, the bitmap continues in areas previously never occupied by its container. This demonstrates what is commonly called bitmap tiling. As seen in step 4 of this figure, when a bitmap is merely broken apart, a single newly created shape is filled with the tiling bitmap. When a bitmap is traced, it is replaced with multiple newly created shapes that contain normal vector fills.
Using Bitmap FillsOnce you break apart a bitmap, it is possible to eyedrop its image into a fill pattern. That pattern can then be used as a fill for a larger shape, creating a seamless tile, as seen in Figure. When a larger shape is filled with a bitmap, the bitmap tiles seamlessly
Once you have a bitmap fill, you can do some creative things with it. For example, you can cover large backgrounds with a sacrifice in file size that pales in comparison to a full bitmap of the same dimensions. In the next project, you will try something a little less intuitive. You can apply tweens to the fill itself:
Tracing BitmapsIn the previous project, you saw that a bitmap behaves as a fill when broken apart. However, you can also convert bitmaps into shapes that respond the way you've come to expect shapes to respond. This is accomplished by tracing the bitmap into a collection of vectors. Using this technique, Flash will analyze a picture and attempt to outline discrete areas of color, based on tolerance settings you provide. The result can be clarified by comparing the process to breaking apart a bitmap, described earlier. Once traced, the first difference is that you can now select an area of vector with one click. After removing that area, pulling away the lower-right corner will effectively increase the size of the self-contained shape manipulated (Figure). This is just how the shapes you are familiar with would behave if a bitmap was never involved. A traced bitmap behaves just like a collection of simple Flash shapes
For your next project, trace a bitmap to gain some experience with the dialog settings:
These three tracings show the successive result of decreasing Color Threshold, Minimum Area, and Curve Fit/Corner Threshold settings. For example, the Color Threshold settings were 100, 50, and 25, from left to right.
Note: If your results are not similar, test your movie. If you then see noticeably different results, you may have your Preview Mode set to a speedier, but rougher, setting. Try changing your View Preview Mode setting to a higher value. If your Flash authoring doesn't slow down significantly, this will enable you to preview your files more accurately as you work.Comparing your file size before and after the tracing usually results in a file size drop, although that's not always true. Sometimes trace tolerances can be set too strictly, and a highly compressed image can be converted into many small vectors, which actually increases file size. One way of getting the most file size economy following a bitmap trace is to optimize your curves:
As a comparative example, bitmap_trace_02.fla, found in the /05/Working with Pixels folder, is an interactive look at different trace settings, complete with possible shape optimization data. Open and test the movie to see the difference a setting can make.
|
- Comment
Break Apart command in Chapter 1, you may want to do so now