r - How to use .ico images in plots programmatically with/without conversion -
how use .ico image files in plots programmatically with/without conversion?
my question follow-up of how convert .ico .png?, targeted r, , following specific details:
i not asking methods involving transcluding icons within
html, e.g. insideshinyapp (author: rstudio). of course possible.can icons
.icofiles used directly in base-r plot, ggplot object (author: hadley wickham) , lattice plot (author: deepayan sarkar)? , approach robust printing outputpdf?how convert
icoiconspngor without dedicatedrlibrary. method careful handle icon's image size, depth, transparency, , other potentially important properties.
the motivation there many open-source libraries of icons 1 use inside plot objects, e.g. inserting image ggplot2, display custom image geom_point, inserting image ggplot outside chart area.
in question cite @ top, how convert .ico .png?, there examples of code in c# , in python, none in r.
install imagemagick on system (your system - not r package). set of open source image manipulation , conversion tools.
from command line can convert icons convert foo.ico foo.png. if ico file contains multiple icons foo-1.ico foo-n.ico. if convert doesn't work you've not installed imagemagick properly.
if want r use system function:
name = "foo" system(paste0("convert ",name,".ico ",name,".png")) then use generated png files. preserve properties (transparency etc), , usable as other png files usable in packages, outside scope of question. have png files.
one could write r package read ico files natively (the spec on wikipedia) seems bit pointless when imagemagick exists , such brilliant job. use it.
Comments
Post a Comment