Animated GIF

Материал из Поле цифровой дидактики

Шаблон:April FoolsШаблон:FeaturedШаблон:Warning Шаблон:Caution Шаблон:Note

Animated GIFs are GIF files with multiple frames that can be played in a sequence, making an animation. Animated GIFs are often used as profile pictures and signatures.

They are very popular on the Internet due to the fact they are animated, unlike other image types. However, they are frequently criticized for overuse, lag, and annoyance, especially flashy ones.

Importing an Animated GIF

There are several steps to import an animated GIF:

  1. Download the animated GIF.
  2. Click on the import button on the sprite's costumes and select the file.
  3. The Costumes Pane should create a new costume for every frame of the animation (This may take a while for large GIF files).
next costume
stamp

Animating the GIF

Шаблон:Main Шаблон:Tip

The following lists steps on how to script an animation to script the animation: A simple way to animate the GIF file in Scratch is to use the following script.

when gf clicked
switch costume to (1 v)
set [fps v] to [16]
forever
   next costume
   wait ((1) / (fps)) secs
end

Another way is to use that script:

when gf clicked
forever
switch costume to (mod(round((timer)/(FPS))((Number of frames))))
end

Replace number of frames for the number of frames. One could just as easily swap out the "fps" (short for frames per second) variable for any arbitrary number. A higher value will increase the speed and the value "0" will cause an soft error(it will run, but not work). Using the first script, the actual frames per second will almost always be a bit less than the variable, due to delay when scratch execute the block "next costume". This can be fixed using a custom block with run without screen refresh enabled, or using the second script. An issue with the second script is that reseting the timer will make the anamation stop working. Using Days Since 2000 is a solution, but days need to be converted to seconds by multiplying by 86400. A typical frame rate for movies is 30 FPS. See this script in action here.

Costumes to Animated GIFs

Just like Scratch can turn animated GIFs into costumes, some people want to be able to turn costumes into animated GIFs.Шаблон:Citation needed This would be very useful as people would be able to export their Scratch animation to another program. Currently, this is not a feature, but there are external and online tools that support this feature, which requires exporting the costumes.

What is a GIF?

A GIF, the acronym of a graphic interchange format, is an animating lossless format for image files that supports both animated and static images. There is no limit for how many frames there are in a GIF but the longer it is, the bigger it is, and sometimes a bit laggier. Standard GIFs run between 15 and 24 frames per second, however the format stores it as a time diffrence between each frame, so a GIF could have unevenly spaced frames.

Bans and Alerts

Flashy GIFs are also prohibited for safety reasons and in severe cases, can lead to bans.

See Also

References

<references/> ja:GIFアニメーション