Title: | Convert Png Files into Animated Png |
---|---|
Description: | Convert several png files into an animated png file. This package exports only a single function `apng'. Call the apng function with a vector of file names (which should be png files) to convert them to a single animated png file. |
Authors: | Quinten Stokkink |
Maintainer: | Quinten Stokkink <[email protected]> |
License: | GPL-3 | file LICENSE |
Version: | 1.1 |
Built: | 2024-11-16 06:33:37 UTC |
Source: | CRAN |
Convert several png files into an animated png file. This package exports only a single function ‘apng’. Call the apng function with a vector of file names (which should be png files) to convert them to a single animated png file.
The CRC implementation in this package was adopted from the W3 Portable Network Graphics (PNG) Specification (Second Edition): Annex D - Sample Cyclic Redundancy Code implementation. As such, special thanks go out to the authors of the specification: https://www.w3.org/TR/PNG/#F-Relationship.
Quinten Stokkink
Maintainer: Quinten Stokkink <[email protected]>
https://www.w3.org/TR/PNG/
https://wiki.mozilla.org/APNG_Specification
Combine multiple png files into an animated png file.
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)
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_den |
the denominator of the frame delay ( |
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.
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)
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)
When rendering a new frame, the previous frame is filled into the alpha of the new frame. For example, 50% red over blue makes purple.
1
When rendering a new frame, the region is filled as specified exactly by the new frame. For example, 50% red over blue makes 50% red over the background.
0
Before a new frame is rendered, the region is replaced by the background color.
1
Nothing is done to the existing buffer when a new frame is rendered.
0
Before a new frame is rendered, the region is restored to what it was before the previous frame.
2