本文于2026-03-28更新。 如发现问题或者有建议,欢迎提交 Issue
可以对图片进行操作。 [@Ooms2018]
基本功能
## Error in `library()`:
## ! there is no package called 'magick'
## Error in `image_read()`:
## ! could not find function "image_read"
## Error:
## ! object 'frink' not found
## Error in `image_trim()`:
## ! could not find function "image_trim"
## Error in `image_scale()`:
## ! could not find function "image_scale"
## Error in `image_flip()`:
## ! could not find function "image_flip"
## Error in `image_rotate()`:
## ! could not find function "image_rotate"
## Error in `image_rotate()`:
## ! could not find function "image_rotate"
## Error in `image_negate()`:
## ! could not find function "image_negate"
frink %>%
image_background("green") %>% # 修改背景颜色
image_flatten() %>%
image_border("red", "10x10") # 加边框## Error in `frink %>% image_background("green") %>% image_flatten() %>% image_border("red",
## "10x10")`:
## ! could not find function "%>%"
## Error in `image_oilpaint()`:
## ! could not find function "image_oilpaint"
## Error in `image_implode()`:
## ! could not find function "image_implode"
## Error in `image_charcoal()`:
## ! could not find function "image_charcoal"
## Error in `image_blur()`:
## ! could not find function "image_blur"
## Error in `image_edge()`:
## ! could not find function "image_edge"
pipeline
library(magick)
file.path('../','picbackup') %>%
list.files(full.names = T) %>%
str_subset('reprex') %>%
data.table(x=.) %>%
mutate(x = map(x,image_read)) %>%
mutate(x = map(x,~image_scale(.,"1000x1000"))) %>%
# resize to fit better
.$x %>%
image_join %>%
image_animate(fps=1) %>%
image_write(
file.path(
'../','picbackup'
,'reprex201811061210.gif'
)
)image_join可以转换list为c()格式,让image_animate调用。 github