Description Usage Arguments Value Examples
Combine multiple png files into an animated png file.
1 2 3 4 | apng(input_files = c(), output_file = "output.png",
num_plays = 0, delay_num = 0, delay_den = 0,
dispose_op = APNG_DISPOSE_OP_NONE,
blend_op = APNG_BLEND_OP_SOURCE)
|
input_files |
to specify the names of the input files |
output_file |
the name of the output file |
num_plays |
the amount of times to repeat the animation (0 means forever) |
delay_num |
the numerator of the frame delay (delay = delay_num / delay_den) |
delay_den |
the denominator of the frame delay (delay = delay_num / delay_den) |
dispose_op |
the frame disposal strategy |
blend_op |
the frame blending strategy |
For more information on blending and frame disposal strategies see https://wiki.mozilla.org/APNG_Specification.
Returns nothing, output is written to output_file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | input1 <- tempfile(pattern = "", fileext = ".png")
input2 <- tempfile(pattern = "", fileext = ".png")
output <- tempfile(pattern = "", fileext = ".png")
# Generate inputs.
png(filename=input1)
plot(1:40, (1:40)^2)
dev.off()
png(filename=input2)
plot(1:40, (-1*1:40)^3)
dev.off()
# Create an animated png.
apng(c(input1, input2), output)
|
Loading required package: bitops
png
2
png
2
Warning messages:
1: In READ_PNG(file_input) :
PNG CONTAINS A PALETTE, PALETTE-LESS PNG (ex. png(type="cairo-png")) IS VERY MUCH SUGGESTED
2: In READ_PNG(file_input) :
PNG CONTAINS A PALETTE, PALETTE-LESS PNG (ex. png(type="cairo-png")) IS VERY MUCH SUGGESTED
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.