Monday, 19 January 2015

M3 Animation For The Web-----Reducing File Size

An animations size will be determined by several factors including length and the format used but in general it can be said that higher quality animations will be larger overall. With a higher quality animation, it is assumed that a greater resolution and color depth will be used which in turn results in more data per pixel that needs to be stored resulting  in a larger total file size. The balance between quality and file size causes many issues for developers and animators with animations of low quality not pleasing the audience whilst animations of high quality may not run correctly on all devices and also fail to please the audience.


Frame disposal:


Frame disposal is a technique used to clear the previous frame before the next frame is loaded in an animated sequence. This prevents the trailing effect that occurs when objects are moved on screen with transparent backgrounds although the technique is not intended to reduce file size. Animations with frame disposal enabled are larger than those without the option enabled as information for each whole frame must be stored alongside the disposal commands even if a frame is no different to the previous one or only changes slightly. Running frame disposal with an animation will also require more processing time at the client end therefore putting more load on the display device due to the extra screen clear operation that must be completed.
Animations created without frame disposal will be smaller in size as only the difference between frames has to be stored within the file and will demand less processing time at the client end with less operations to complete per frame load, allowing them to run smoother on low powered devices but sacrificing the flexibility of a disposed sequence.

Frame disposal in Photoshop example:

Once all the required layers/frames have been created within Photoshop and converted into a timeline of frames the frame disposal settings can be adjusted as required. All frames must be selected and then the disposal menu can e accessed by right clicking any of the selected frames. Menu shown below.



Frame Disposal:





No Frame Disposal:
N







Auto Crop

Auto crop is an option that can be selected to remove unwanted image data from a frame in order to reduce it's size. For example; If an object was drawn in the center of the stage and only took up a small area then, with Auto crop selected, all the unused space around the object would be cropped off (Excluding motion paths) and the location of the object stored so that it can be placed on the stage.
Auto crop is an effective method of reducing file size by significantly reducing the overall quantity of pixel data that has to be recorded for an animation to function.

Auto-crop can be selected within fireworks by selecting all states of an animation and right clicking to open this menu.
Clicking auto crop will crop all frames down to the minimum required space to contain only the image data and motion paths in order to reduce animation file size.


     Auto crop example:


No Auto Crop:



Auto Crop:




The above animation was cropped within Adobe fireworks with the black border added in order to show where the frames were cropped to. In the first animation a large amount of empty space can be seen whilst the second animation has had this empty space removed by the fit canvas/auto-crop feature in order to remove unwanted content and reduce the animation size.
The un-cropped animation is 15.5 Kb in size whilst the cropped example takes up 13.6 Kb, this is  only a small difference in size but when longer animations are used and processed the technique could dramatically reduce file size.



The auto crop feature is referred to as "fit canvas" although performs exactly as an auto crop operation. Simply click the fit canvas button as shown above to shrink the canvas to the minimum size whilst still including all objects and motion paths.


When animating for the web there are several factors that can effect the file size of a sequence:


The color depth or number of colors within an animation will determine the amount of data that is required to store one entire frame with higher color depths requiring more data, therefore making the overall file size greater. (Assuming comparison between an animation of equal length and resolution at a lower color depth)

The use of either vector or bitmap graphics can have a significant effect on the overall size of an animation due to the different ways that image information is stored. With bitmap frames each individual pixel must be stored separately in turn resulting in a larger file size whilst with vector graphics,  frames are stored as a set of mathematical equations which means that each pixel is not recorded but the image is rendered or drawn when displayed on screen. Because of this, files are significantly smaller than bitmap types.    

The physical size of images animated will directly effect the size of a finished animation. Images have to be stored may times throughout an animation so when large images are multiplied by the number of frames they are displayed on the total size can grow quickly.  

Each frame added to a sequence will increase file size and with more frames added, the sequence will grow in size accordingly.  Longer sequences comprised of the same frame resolution and color depth will therefore take up more space than those with fewer frames.

The rate at which frames are replayed will have a direct impact on the number of frames required for a set animation length. For an animation with a length of 10 seconds at 24 frames per second a total of 240 frames will be required whilst at a frame rate of 48 fps a total of 480 frames will be required. The animation at 48 fps would therefore theoretically have a size double that of the animation run at 24 fps. Running an animation at more than 24 fps is impractical for web applications as the human eye cannot distinguish individual images from one another.      

Resolution, or the number of horizontal versus vertical pixels in a frame, will directly dictate the amount of pixel data to be recorded so that with higher resolutions more data must be recorded in turn increasing file size whilst with lower resolution frames the total number of pixels will be smaller and require less information to be recorded resulting in smaller file sizes.





Output device issues

Many different devices can be used to display animated content from small mobile screens to large public display boards.

Users may view content personally on there home computer, tablet or on a mobile device such as PDAs and smartphones although animated content may also be found on large public display boards in areas such a shopping centers for commercial purposes as well as through media including TV/Commercials or advertising.

Designing and optimizing an animation to be compatible and successful across multiple platforms can become a great challenge due to the difference in many factors between platforms. Smaller devices such as smartphones or PDAs will have much smaller screen resolution's and may not be able to display all the required content at the same time whilst other factors such as the download speed of connections and physical device processing speed can dramatically effect the appearance of an animation including how smoothly it runs. On device with lower processor speeds animations may run "jerky" and be unpleasing to view whilst downloading content through a slower connection could take long periods of time and put users of watching animations.
Designers must include provisions to adapt animations to the device that is being used such as different resolutions for differing devices and streaming options in order to reduce the loading times of content.

Differences in the resolution between platforms can present a challenge to animation design. If the end user's device has a greater resolution on screen than the content to be displayed then the animation will not fill the screen without zooming in, in turn producing pixelation and unwanted visual effects. If an animations resolution is greater than that support by a device some of the visual content may be lost or cropped off as it cannot simply fit on screen.    

The color depth of device displays can have a dramatic effect on how content is viewed by the end user. If content is created in a higher depth than the end user can display then visual artifacts and color distortion may occur or the file may become un-displayable on certain hardware.

File type is one final consideration that should be mentioned as it is crucial that content is released in a format that is universal between platforms. If content was released in a format such as flash and a device could not support this then the content would be useless regardless of the other considerations above.

E Cards




E-Cards are electronic cards usually comprised of short animations containing a message.
They are free to create and normally small in file size due to the use of the GIF format which makes them easy to distribute via Email.

Unlike conventional cards, the electronic card is completely digital and relies on a computer or device to display the animated sequence contained within. Because of this, such cards are free to create and many sites offer tools which allow for easy creation and distribution of such content with the ability to send cards instantly to anyone via an email account.

One problem that arises with use of such a format is the fact that a device must be running in order to display electronic cards so that they cannot be simply displayed like a paper card and may not be considered quite so personal due to the lack of physical content.

E-Cards can use animated content in either GIF or SWF file formats, with the later allowing for user interaction such as buttons, although the most popular simple cards will most likely use a GIF file due to reduced size and widespread compatibility across platforms.  Shock-wave flash files will allow for the integration of sound opposed to the image only limitation with GIF files which allows for more complicated designs to be used if desired including music or voice overs to animated scenes and personal messages.

An email attachment is a file embedded within an Email message and is often symbolized with a paperclip. Such files are limited to a few megabytes in size (Typically) and are often restricted to exclude .exe or binary files form being transferred due to security constraints. As E-Cards are animated sequences and are not commonly used to carry malicious information GIF and .SWF files can typically;y be attached to EMAIL messages and transferred.

http://www.jacquielawson.com/cards/birthday

The above site allows users to select pre-made E-CARDS and send them via email although no editing options are provided on the site. The cards available include interactive element such as mouse click inputs in order to make the final card more involving for the end user. Cards can be sent directly from the website providing that the user has an account.

Rollover Demonstration

<--Image 1

<--Image 2



Rollover is the term used to describe content that changes when the cursor is placed over it. For example a button that changes color when hovering the cursor. 
Rollovers are often used within navigation on websites to create a more interactive feel to the site by changing or revealing content as the user interacts on screen and to improve the overall appearance of a site. 
Rollovers can be frustrating as there is no way to prevent the action form occurring with accidental movements over elements and so layouts may become confusing if too many rollovers are used. It may be more appropriate to require the user to click on an element to reveal more options opposed to having this trigger with a simple mouse over command. 


Java script for the rollover example below:


<script language="javascript">
        function MouseRollover(MyImage) {
        MyImage.src = " button2.png";
    }
        function MouseOut(MyImage) {
        MyImage.src = " button1.png";
    }
</script>
<br />
<div align="center">
<!--The rollover image displays here.-->
<img border="0" onmouseout="MouseOut(this)" onmouseover="MouseRollover(this)" src=" button1.png" />
</div>




Final Rollover button below: