Commons:Stroke Order Project/Graphics guidelines/Bitmap animations

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Model of Bitmap animation (by wave = better)
Model of Bitmap animation (by stroke = able)
See RoC stroke order document.

Create the stroke-snapshots[edit]

  1. Create a white square 300x300 px, and center the character in size=300. Reduce the picture palette to black/white 6 colors. Save this first picture as "00.gif".
  2. Color the character light gray (R: 192; V:192; B:192) and reduce the picture palette to black/white 6 colors. Save this second picture as "01.gif".
    Hint : use the luminosity / contrast until the solid black is transformed into a light gray.
  3. Then create each step of the animation, showing the progression of the black ink on the gray shadow. Use "01.gif" as the background and "00.gif" as the upper layer. There should be:
    • (at least) two steps for dots and short strokes (three may be better),
    • (at least) four steps for long linear element,
    • one step for the drawing pause corresponding to direction changes.
    Hint : Remember that the characters are drawn by hand and with a brush, which should be visible in your rendering : (1) The limit between undrawn and drawn is the edge of the brush, which tends to be sharp and half-circle shaped ; (2) You may speed in long straight lines, but do slow down at sharp angles ; (3) Adjust the first and the last image of a stroke to reflect the way the brush hits and leaves the paper.
    Hint : To keep the edges smooth, (1) create the pictures in reverse order, start with the full character, and use the eraser to turn "off" the undrawn parts ; (2) while erasing ignore the borders, erase the picture to transparent, then project the partial character on the gray shadow.
  4. Reduce each picture palette to black/white 6 colors and save under an incremented filename.

Animating the strokes[edit]

  1. Compile them to create an animation in the .GIF format. Load the steps in order, beginning and ending with the completed image, 00.gif. (Hint: Look for a command that performs this operation in one step).
  2. Set the delay time. The default delay between pictures should be set to 10 (10/100 of a second). Adjust the delays between strokes by hand thus:
    • First picture (black character), delay = 100; second picture (grey character), delay = 75.
    • The transition delay between the steps of a stroke is delay = 10.
    • Delay between two strokes is delay = 50.
    • Delay between two picture elements (keys, compound characters) should be increased: 75-100.
    • Final picture: delay = 100, and set the animation to cycle again (number of repeat = infinity).
  3. Optimize the file (palette reduction, use transparency & superposition, reduce data to changed rectangles) to reduce size and loading time, and save.

Upload the file and add {{SOlicense}} to it for licensing and automatically categorising it.

Backward character construction[edit]

To build the animation backward, here is my method (The names may not be correct, since my GIMP version automatically runs in French - sorry...) :

  1. Create a 300x300 frame, white background, black ~ 270pt centered character (it should leave ~ 30 to 50 px on all four sides). (Check that the edges are smoothed with gray aliasing.) Make sure the "image mode" is color to enable brightness and saturation adjustments. Open the frame stack manager (Ctrl+L). Call that first frame "Background (1000 ms)". Zoom in (200% - 300%) for more comfortable editing.
  2. Duplicate the background (frame manager, right click). Change the name to "(1000 ms)#2". Duplicate #2 (the name should switch to "(1000 ms)#3"). Change that name to "(100 ms)#3" (this will be the default frame delay).
  3. Edit frame #2. Use the "luminosity / contrast" twice setting the "luminosity" cursor all the way up, ending with a light gray character on a white background. This is your gray background reference (upon which the character will appear in transparent mode).
  4. Edit frame #3. Use the "magic stick" color selection tool, select and eliminate all white background, ending with a black character with gray aliased edges on a transparent background. This is your final character (once everything is drawn). End of preparations, un-select the current selection, choose the "eraser" tool and start to "undraw" the character :
  5. Drawing loop : [ Duplicate frame #N, creating a N+1. Edit frame N+1 and erase the character part that should have been painted last at this stage (you are building the animation backward), taking into account speed considerations (slow = small variation).]

    Repeat that drawing loop, until everything is erased (typically, creating 3-4 frames for each line segment of the character). Well - almost everything, there is no need to create the last empty stage.

    This is where you should use your artistic and technical sense of brush painting, and technical sense of animation : choose intermediary frames that correspond to significant brush positions or line crossings, slow down in curves and endings, move faster in straight lines, use a curved erasion limit compatible with a brush shape... and so on.

    Just be careful : when two lines are crossing, the result after erasing the first one will be seen for a relatively long time, so that result should be tidy and look like a shape a brush can leave. For instance, look at file:中-order.gif, the end of the hooked second strike is rounded before being covered by the third horizontal strike.

  6. Once all the drawing frames have been created (in reverse order) : Reverse the order of frames in the stack (frame menu, stack submenu, reverse command). Then, select the gray character (now second topmost), and put it at the bottom of the stack (shift + arrow-down-button), then select the black background (topmost), and put it at the bottom of the stack (the gray is now at position 2, of course). Your frames are in correct animation order, you may want to check that (filter / animation / play). Feel proud? If it works, you should ;o)
  7. Adjust the default 100ms time delays to ~ 500ms between two strikes, ~ 800 to 1000 ms between two character components, 1000 ms for the last (complete character) frame. Check if the animation is correct and "feels" right (filter / animation / play) and adjust if necessary, especially if angles are drawn too quickly.
  8. When everything is OK, use the "Filter / animation / optimize (GIF)" to create an optimized version ; check the animation ; switch to a low-definition "palette" mode (15 colors are perfectly sufficient) for space and bandwidth optimization ; and save the result.

This "reverse drawing" method is very fast, because the only thing you do is basically erase the character, with no need to fine-tune the resulting picture for aliasing problem (apart where strikes cross), and that can be done in no time. A character of medium complexity (金) can be drawn in ~ a quarter of an hour ; and when I make an error in the stroke order, I find it more convenient to start anew than to edit the GIF file and adjust the picture components by hand. (Michelet-密是力 (talk) 06:46, 14 July 2009 (UTC))

Major contributors[edit]