trait ToAnimatedActionTrait

Trait ToAnimatedActionTrait

Methods

sampling(int|string $value)

Sets the total number of frames to sample from the original video.

delay(Delay|int $delay) deprecated

Sets the delay between frames of an animated image in milliseconds.

format(AnimatedFormat|string $format)

Sets the animated image format.

Details

ToAnimatedActionTrait sampling(int|string $value)

Sets the total number of frames to sample from the original video.

Relevant when converting videos to animated GIF or WebP format. If not specified, the resulting GIF or WebP samples the whole video (up to 400 frames, at up to 10 frames per second). By default the duration of the animated image is the same as the duration of the video, no matter how many frames are sampled from the original video (use the delay qualifier to adjust the amount of time between frames).

Parameters

Name Type Description
$value int|string Integer - The total number of frames to sample from the original video. The frames are spread out over the length of the video, e.g. 20 takes one frame every 5%. String - The number of seconds between each frame to sample from the original video. e.g. 2.3s takes one frame every 2.3 seconds.

Return Value

ToAnimatedActionTrait

ToAnimatedActionTrait delay(Delay|int $delay) deprecated

deprecated use Animated::edit()->delay($delay) instead.

Sets the delay between frames of an animated image in milliseconds.

Parameters

Name Type Description
$delay Delay|int

Return Value

ToAnimatedActionTrait

See also

AnimatedEdit

ToAnimatedActionTrait format(AnimatedFormat|string $format)

Sets the animated image format.

Parameters

Name Type Description
$format AnimatedFormat|string The format.

Return Value

ToAnimatedActionTrait