【发布时间】:2019-05-22 16:29:57
【问题描述】:
我有一个使用 magick 包读入 R 的 gif 文件,我想对每帧的图像边缘进行模糊处理或添加羽化效果。我从文档中看到这在 ImageMagick 中是可能的(例如 https://www.imagemagick.org/Usage/morphology/#distance_feather 和 https://www.imagemagick.org/Usage/transform/#vignette),但无法弄清楚如何将此信息转换为 R。我需要使用哪些魔法函数和参数来制作这会发生吗?
我知道我需要单独处理 gif 的每一帧,例如:
img <- image_read("myGif.gif")
featheredGif <- _____ # ????insert a function to feather edges, applied to img[1]
for(i in 2:length(img)){
featheredFrame <- _____ # ???? insert function to feather edges, applied to img[i]
featheredGif <- c(featheredGif, featheredFrame)
}
我希望结果看起来类似于此https://www.imagemagick.org/Usage/thumbnails/soft_edge.png 或此https://www.imagemagick.org/Usage/morphology/rose_feathered.png,但应用于 gif 中的每一帧。
【问题讨论】:
标签: r imagemagick