Week 6 Topics
Chapter 8 - Bitmaps
In a bitmap, the color of each individual pixel is stored individually. This
is great for photographs but the file sizes are large. Typically bitmap images
on the web are in one of two formats - gifs and jpgs. Gifs are limited to 256
colors and the gif compression algorithm can take advantage of adjacent pixels
of the same color to store information about these pixels in a manner than conserves
file space. Because there are only 256 colors permitted, the chances of adjacent
pixels having the same color is much higher than if more colors were permitted.
In addition, the gif algorithm uses an indexing approach, so that the value
stored isn't a color value (which would take 24 bits) but merely an index into
an array with a maximum size of 256. (requiring only 8 bits). The array itself
contains the color value. Images in the .jpg format can have 256x256x256 colors
(over 17 million) are thus used for photographs whereas gifs are used for just
about everything else.
For gifs, the file size and quality of the image is determined by choosing
the number of colors (in powers of 2 up to 256) whereas for jpgs, the file size
and quality is determined by choosing a quality value of between (0-100) which
determines the amount of compression. Gif compression is known as lossless and
jpg as lossy. The gif compression is lossless only after the conversion to a
maximum of 256 colors.
Exercise 1 - Importing and Compressing Bitmaps
- Open a new document and save it as import.fla. Choose File>Import and
browse to the import1.jpg file, select the file and click Open. When you add
a bitmap file in this way, the file is placed on the Stage aind in the Library.
- Press F11 to open the library and select the import1 image inside the Library.
Click the Properties button at the bottom of the Library to open the Bitmap
Properties dialog box.
- In the Preview window, click and drag te picture until you see the portion
of the picture you care the most about. This will give you a better indication
of the effect of the compression changes you are about to make.
- Select te Compression option to Lossless and click the Test button to see
the compression information. If you click OK, this setting will alter the
bitmap in the Library and the instance on the Stage.
- Change the Compression option to Photo (JPEG) and uncheck the Use Imported
JPEG data check box, and then the quality setting choice will appar. Set the
quality to 80 and Press Test, and notice the resulting appearance and file
size. Click OK and save and close the file.
Exercise 2 - Importing Bitmap Sequences (using bitmapSequenceFinal.fla and
bitmapSequence.fla)
- Open the final version of the file and Press Enter to Preview it. Close
the file and open the other file.
- Choose File>Import (Ctrl-R Windows) and open the sequence folder and
select the file bigair--01. Flash will then ask you whether you want to import
all of the images in the sequence (the images should be numbered in the order
in which you wish them to appear). Choose Yes. Flash imports all 14 images
and creates a new keyframe for each one in the Timeline. By default, it will
put them at the upper left hand corner of the Stage.
- In the status bar of the Timeline, click the Edit Multiple Frames button
and position the Edit Multiple Frames bars to span all the frames. Click on
the right of the layer name to select all the frames and then click and drag
the bitmap image into the center of the Stage. This repositions all the frames
at once.
- Select Control>Test Movie. In the Property Inspector, change the frame
rate to 16. Test it again; now try a frame rate of 6. Save the file when you
are satisfied.
Exercise 3 - Converting Bitmaps to Vectors - You can turn imported bitmaps
into vector art by using Trace Bitmap
- Using the previous file, make sure the Edit Multiple Frames button is not
selected. In frame 1, select the image on the stage and choose Modify>Trace
Bitmap. Decrease the Color Threshold to 80 and the Minimum Area to 5. For
Curve Fit, select Very Tight and for the Corner Threshold, select Many corners.
Click OK.
- Move the Playhead to Frame 14 and repeat this process but use Color Threshold:20,
Minimum Area: 10, Fit: Very Smooth, and Corner Threshold: few corners. This
will turn the bitmap into a shape that has little detail. Repeat these steps
to trace the remaining 12 images. This results in vector simulated video footage.
Look at the file size compared to the all bitmap version, and zoom in and
you don't lose detail.
- Color Threshold: 1 to 500 (the amount by which the color of each pixel can
vary before it is considered a separate color) Minimum Area: 1 to 1000 (the
number of surrounding pixels to consider when calculating the color of a pixel)
Curve fit and Corner Threshold
Exercise 4 - Basic Masking (using mask.fla) - A mask is a special layer that
defines what is visible on the layer below. Only layers that are beneath the
shapes in the mask layer will be visible.
- Open the mask.fla file and choose File>Import to open the sideMountain
file. Double click the Layer 1 name to rename the layer as mountain. Lock
this layer by clicking the dot on this layer underneath the Lock icon.
- Click the Insert Layer button to insert a new layer about the mountain layer.
If it's not above the mountain layer, drag it above. Rename this new layer
xboarding. Open the Library by pressing F11.
- Drag the symbol siteName onto the xboarding layer and position the X on
top of the snowboarder.
- Choose Modify>Layer and select Mask to turn the xboarding layer into
a mask layer. Double click on the mountain layer icon and choose Masked in
the Layer Properties box. The mask layer will have a blue checkerboard oval
and the maksed layer will be indented and display a checkerboard square with
the lower right hand corner turned up. The lines that separate the mask and
the masked layer will be dotted rather than solid.
- Lock the xboarding layer (both the mask and the masked layer must be locked
to preview).and you will see the bitmap showing through the text shapes. Save
the file.
Exercise 5 - Animated Masks -- in this exercise we will create a text mask
that moves over a bitmap background
- Use the previous file. On the xboarding layer, click on Frame 20 and press
F6 to add a keyframe. On the mountain layer, click on Frame 20 and press F5
to add frames so that the background will be visible throughout.
- Unlock the xboarding layer and select the first keyframe and move the xboarding
symbol instance off the Stage to the left.
- Choose Modify>Transform>Flip Vertical. In the timeline, select a frame
between frame 1 and 20 and choose Motion in the Tween drop down menu in the
Property Inspector. Click on the Lock icon to lock the xboarding layer and
then press Enter to preview the movie. Save and close the file.
Exercise 6 - Breaking Apart Bitmaps (using effectsFinal.fla and breakApart.fla)
- Open the final version and preview by Control>Test Movie (Ctrl + Enter).
Close the file and open the breakApart.fla file which is a blank file with
a black background. Choose File>Import and browse to the file boarderCloseUp
and double click it to open it. Rename Layer 1 in the Timeline to boarder.
- Select the bitmap on the Stage and choose Modify>Break Apart. This will
turn it into a vector, but only affects the instance on the stage and not
the original in the Library. Select the Pencil tool, setting the stroke color
to black and choose Smooth from the pencil mode options. Draw a line around
the boarder making this a continuous line.
- Click off the Stage to deselect the bitmap, click on the area outside of
the outline -- this will select the area outside the line. Press Delete on
the keyboard and the image has been cropped. Save the file.
Exercise 7 - Stroking a Bitmap
- Using the file from the previous exercise, save this file as strokeAnim.fla.
Move the cursor over the line you drew and click on it to select it. Change
the stroke color to White so that you can see it. Choose Edit>Cut to cut
the stroke out.
- Lock the boarder layer and click the Insert Layer button to add a new layer.
Rename the new layer to stroke. Hide the boarder layer.
- With the boarder layer still selected, choose Edit>Paste in Place. This
will position the stroke. Press F6 to add 4 keyframes to the stroke layer.
Move the Playhead back to Frame 1 and using the Eraser tool, draw over most
of the stroke. When you release the mouse, only the portion of the stroke
you didn't draw over will remain. (Note: you can change the size of the Eraser
Tool in the Eraser Shape dropdown menu)
- Move the Playhead to Frame 2. Using the Eraser tool again, again draw over
the Stroke, but allow more of the stroke to remain. Repeat this for Frames
3,4, and 5 and press Enter to preview the animation. Save the file,
Exercise 8 - Combining Bitmaps and Vectors
- Using the file from the previous exercise, save the file as effects.fla.
Lock the stroke layer and unlock and unhide the boarder layer. On the boarder
layer, click on Frame 1 to select it and drag it to Frame 6. Select the boarder
and press F8 to convert it to a symbol. Name the symbol boarder and choose
Graphic. {Note: you are converting this to a symbol because we are going to
be applying an alpha effect.)
- Select Frame 20 and press F6 to add a keyframe. Move the playhead back to
frame 6 and select the boarder instance on the stage. In the Property Inspector,
set Color Style to Alpha 0% and click anywhere between Frame 6 and Frame 20
and select Motion from the Tween drop-down menu in the Property Inspector.
- In the stroke layer, select Frame 20 and press F5 to add frames to match
the number of frames on the boarder level. Press Enter to preview the animation.
- In the Timeline, lock the boarder layer and click Insert Layer to add a
new layer and rename it background. Drag it below the boarder layer on the
Timeline. Select Frame 20 and press F7 to add a blank keyframe. Hide the stroke
and boarder layer.
- Press F11 to open the library and drag an instance of boarderCloseUp onto
the Stage. Select Window>Align to open the Align panel if it is not already
open. Center the bitmap by clicking the To Stage button and the Align Vertical
Center and Distribute Horizontal Center buttons.
- With the snowboarder bitmap still selected on the Stage, press F8 to convert
it into a symbol. Using the Symbol Properties dialog box, name the symbol
origImage and select Graphic for Behavior. {We are converting this to a symbol
so that we can do a motion tween)
- Select Frame 35 and press F6 to add a keyframe. Move the playhead back to
Frame 20 and select the bitmap on the Stage -- in the Property Inspector,
set Color Style to Alpha 0%,
- Click anywhere between Frame 20 and Frame 35 to select a frame and then
choose Motion from the Tween drop down menu.
- In the boarder layer, select Frame 35 and press F5 to add frames to match
the number of frames on the background layer.
- Click and drag down on Frame 45 in the boarder and background layer to select
Frame 45 in both layers. Press F5 to add frames. Press Enter to preview the
animation or Control>Test Movie. The outline will draw itself, the boarder
layer will fade from invisible to full color, and then the background will
fade in. Save and close the file.
Revised: February 20, 2006. Comments to William Pegram, wpegram@nvcc.edu