Tripredacus (and CoffeeFiend, too, if you feel like making any comments)In your Post # 299, you mentioned that doing without a background animation would reduce the file size.
For the 571 KB, 160-frame animation shown below, eliminating a 4-frame, 17 KB (i.e., the file size when played by itself) background animation reduced the file size down to 288 KB.
If you have any comments about the "GIF mathematics" involved in this great file-size reduction -- (i.e., reduced by about half) -- I'd sure like to hear them, for I was very surprised at the magnitude of the reduction.
Thanks
---------------------------------------------------------------------------------------------------------
The 2 GIFs shown below are frame-by-frame animations: 160 frames, 0.08 sec display time per frame, 1px per frame vertical-scrolling rate for the figures, 255 colors, 350x19px. The letter "pulsations" stay in place for 2 frames, so the actual display time for each pulsation is 2x(0.08)=0.16 sec.
The image immediately below uses a single frame -- hereafter referred to as SF -- for the background of all the frames in the animation. Of course, SF is the typical userbar background having an ellipse layer and scanlines (in this case, white and diagonal with a 5px horizontal spacing) over a JPEG background. This GIF animation has a file size of 288 KB, http://postimage.org/image/toadbls41/

I wanted to "jazz up" the above image by using an actual animated GIF for the background, so I made a simple 4-frame one based on SF according to the frame sequence [SF(br=-15),SF,SF(br=+15),SF], where SF(br=X) represents SF being given a Photoshop Brightness Adjustment of X. Of course, the 4-frame sequence will loop indefinitely. The resulting background animation goes in repeating cycles of dark to light and back to dark again (it should be clear that this animation "averages out" to be SF). I experimented with different - and + brightness values -- (specifically, -10,+10 and -20,+20) -- to get a background animation that wouldn't "overwhelm", or compete with, the drummers, but at the same time would be easily visible. The -15 and +15 worked fine, IMO, as can be seen in the result below, http://postimage.org/image/k0x7r38k3/
This animation has a "whopping" file size of 571 KB. The 4-frame background animated GIF I made had a rather small file size of 17 KB (when played by itself), yet when it was "added" to the 288 KB first-shown image above, it resulted in the 571KB whopper.
Now, I'll give some details concerning the construction of the above animations.
This is the first time that I have scrolled an animated GIF.
Previously, I had only scrolled static images (i.e., JPEGs), but the basic procedure is essentially the same.
There are many, many web sites that offer GIF animations for free to be used in any way by the downloader.
I liked the drummer GIF because of its high energy, http://postimage.org/image/8zwc1t4cn/
I opened this GIF in my animator, which analyzed it as: 5 frames, 0.10 sec display time per frame, 95x100px, 13 KB.
The scrolling of the 5-frame GIF was similar to that of static-image JPEGs. I aligned and stacked the drummer frames on top of each other on the left and right sides of the userbar. I linked the 5 frames on the left side (and on the right side) so that they would move as a *unit* when I scrolled them 1px per frame. To make the PS layer (for the images) at a particular vertical position, I copied the appropriate drummer frames on the left and right sides of the userbar, and linked and merged them.
The images below show the simple steps used to make this animation.
The image immediately below shows how I made frame 1 of the animation (shown without the background layer, of course), http://postimage.org/image/x5rtls2f1/

The 5 drummer GIF frames are shown stacked (and linked) on top of each other for each side of the userbar. For frame 1 of the animation, I used *only* frame 1 of the drummer GIF, which is shown on top of the drummer stack. The red horizontal line for the left-side drummer is covered up by the border. This image also shows that I made the left and right side drummers to be mirror images of each other, to increase visual interest. Of course, the left-side linked drummers move up (1px per frame) and the right-side linked drummers move down (1px per frame) until they traverse the height of the userbar, and then, after a "pause", they reverse direction in the vertical scrolling.
"Be happy!! Bang on the drum all day!!" has 30 characters, and since each pulsation stays in place for 2 frames, this text occupies 60 frames, or 120 frames when repeated twice in 1 loop of the animation. (160 total frames)-(120 frames with pulsations)=(40 frames without pulsations). So, it's clear that the 2 text pulsations should be separated by 20 frames without pulsations. I started the pulsations on the "B" in "Be" when the drum head on the left side of the userbar was in view, and the rest of the pulsations were determined by the above "calculations". That is why the "D" in "Day" is pulsed in frame 1 of the animation.
The single frame (SF) background was used to make the first animation (288 KB) shown in this Post,
http://postimage.org/image/g5p8as00j/

The 4-frame animated GIF background, [SF(br=-15),SF,SF(br=+15),SF], 17 KB, was used to make the second animation (571 KB), shown in this Post,
http://postimage.org/image/4zqbw30gj/

As a final comment, I made the background animation to be 4 frames so that it would be mostly out of sync with the 5 frame drummer animation, to increase visual interest. Of course, (160 total frames)/(number of frames in a sub animation) has to be an integer (i.e., number of loops of the sub animation). Making 8 duplicate frames at both transition points in the main animation to bring the total number of frames to 160 satisfied the "integer requirement" [i.e., (160/5)=32 and (160/4)=40].

---------------------------------------------------------------------------------------------------------
I don't want to work
I want to bang on the drum all day
I don't want to play
I just want to bang on the drum all day
Todd Rundgren
---------------------------------------------------------------------------------------------------------
This post has been edited by larryb123456: 25 August 2012 - 12:57 PM



Help


Back to top























































