Creates a frame of an image. The frame uses the image as it is (it isn't copied): changes to it are the frame's
The frame's pixels
Optionaloptions: FrameOptions
See FrameOptions
The frame's disposal mode, see FrameDisposalMode
Sets the disposal mode
The mode's name ('any', 'keep', 'previous', 'background')
The frame's duration in milliseconds (a finite number from 0, else it throws a RangeError). It doesn't have to be a whole number: encoding rounds it, to whole milliseconds for APNG and WebP and, as GIFs store hundredths of a second, to 10 ms for GIF (1.5 ms becomes 0, 5 ms becomes 10). Browsers play GIF frames shorter than 20 ms with 100 ms
Sets the duration
Milliseconds, a finite number from 0
The frame's height (its image's)
The frame's width (its image's)
The frame's horizontal offset in the animation: an integer, values with a fraction are truncated like image sizes (a value that isn't a finite number throws a RangeError)
Sets the horizontal offset
The offset in pixels
The frame's vertical offset in the animation: an integer, like Frame.xOffset
Sets the vertical offset
The offset in pixels
Clones the frame: its image (with its pixels and gain map), duration, offsets and disposal mode
Crops the frame to a region of it, moving the offsets so the remaining pixels stay where they are in the animation. The region is clipped to the frame
The x offset in the frame (0-based)
The y offset in the frame (0-based)
The new width
The new height
Adds a shadow behind the frame's image, like Image.dropShadow: when it grows up or left, the offsets move so the image stays where it is in the animation
Optionaloptions: ShadowOptions
See ShadowOptions
Draws an outline around the frame's shape, like Image.outline: when it grows up or left, the offsets move so the image stays where it is in the animation
Optionaloptions: OutlineOptions
See OutlineOptions
Resizes the frame, scaling its offsets along with it (as if the whole animation was resized by the same factor)
The new width
The new height
Optionaloptions: ResizeOptions
See ResizeOptions
Resizes the frame, scaling its offsets along with it: to the given width or height (the other side keeps the aspect ratio), or to both
The size and how to resize, see ResizeToOptions
Rotates the frame clockwise around its middle, like Image.rotate: when it grows (or shrinks), the offsets move so its middle stays where it is in the animation
The angle in degrees, clockwise
Optionaloptions: RotateOptions
See RotateOptions
Scales the frame by a factor, and its offsets along with it
The factor
Optionaloptions: ResizeOptions
See ResizeOptions
A short description for debugging, e.g. Frame<64x64x100ms>
Transforms the frame with an affine transform, like Image.transform: when it grows, the offsets move so the transform's origin stays where it is in the animation
The six values [a, b, c, d, e, f]
Optionaloptions: TransformOptions
See TransformOptions
Removes borders of one color, moving the offsets so the remaining pixels stay where they are in the animation
Optionaloptions: TrimOptions
See TrimOptions
A frame of an Animation: an Image (Frame.image) with a duration, offsets and a disposal mode
Remarks
The frame has the methods that change the image's size (
resize()including its'contain'and'cover'fit modes,scale(),crop(),trim(),rotate(),transform(),dropShadow()andoutline()), which move the offsets along so the frame stays in place in the animation; every other change goes to the image (frame.image.blur(2)). The image's own size-changing methods leave the offsets as they are. Offsets can become negative: the parts of a frame outside the animation's canvas aren't encoded