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. inside shiny app (author: rstudio). of course possible.

  • can icons .ico files used directly in base-r plot, ggplot object (author: hadley wickham) , lattice plot (author: deepayan sarkar)? , approach robust printing output pdf?

  • how convert ico icons png or without dedicated r library. 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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -