Closed zajichek closed 1 year ago
This was the process taken to create the logo:
Generate an image from the desired concept from Canva (for free): https://www.canva.com/your-apps/text-to-image (searched the concept of something like "an animated concept of a web application that uses risk factors as individual components to produce personalized risk estimates")
Upload the resulting image to http://connect.thinkr.fr/hexmake/ to make the hexagon logo, using the various imaging effect editors, etc. (however, the image zoom I wanted went out of the hexagon, so I needed to figure out how to trim it)
Use the hexSticker
and magick
R
packages to trim the boundaries as transparent. This was an excellent resource which I basically used verbatim: https://github.com/GuangchuangYu/hexSticker/issues/39#issuecomment-889786759
I ran the following R
code:
# Load the packages
library(hexSticker)
library(magick)
# Path to image downloaded from hexmake app
raw_logo <- "<path to image>/hex-riskcalc.png"
# Add whitespace to the boundaries by refitting a sticker
sticker(raw_logo, package="",
s_x = 1, s_y = 1, s_width = .85, dpi = 600,
h_color = "#5699AD",
white_around_sticker = TRUE,
filename = "temp_sticker.png")
# Import temporary logo
p <- image_read("temp_sticker.png")
# Fill in boundaries with transparency (note, use the object's width/height in the 'point' argument)
pp <- p %>%
image_fill(color = "transparent", fuzz = 4, point = "+1+1") %>%
image_fill(color = "transparent", refcolor = "white", fuzz = 4, point = "+1036+1") %>%
image_fill(color = "transparent", refcolor = "white", fuzz = 4, point = "+1+1199") %>%
image_fill(color = "transparent", refcolor = "white", fuzz = 4, point = "+1036+1199")
# Write the image to a file for use (this is the final logo)
image_write(image = pp, path = "<path to image>/hex-riskcalc-final.png")
file.show("<path to image>/hex-riskcalc-final.png")
We end up with the final logo
usethis::use_logo("<path to image>/hex-riskcalc-final.png")
to add image to package's man/figures/
and generate code to place in READMEdevtools::build_readme()
main
Note because of the Actions workflows in place, the pkgdown
site automatically updated with the image.
This was already done is this commit: https://github.com/ClevelandClinicQHS/riskcalc/commit/0568aead9da832ed88e35bd34f93dd6ad3ccc628
But adding an issue with notes for the sake of process documentation.