Skip to content

Commit

Permalink
sticker tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaette committed Jul 15, 2018
1 parent 237935b commit 54a2d01
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.Rmd
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(
)
```

# The GermaParl R Data package <img src="https://github.com/PolMine/GermaParl/blob/master/inst/sticker/hexsticker.png" align="right" />
# The GermaParl R Data package <img src="https://raw.githubusercontent.com/PolMine/GermaParl/master/inst/sticker/hexsticker.png" align="right" />

### About

Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# The GermaParl R Data package <img src="inst/sticker/hexsticker.png" align="right" />
# The GermaParl R Data package <img src="https://raw.githubusercontent.com/PolMine/GermaParl/master/inst/sticker/hexsticker.png" align="right" />

### About

Expand Down
2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified inst/sticker/hexsticker.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions inst/sticker/make_sticker.R
@@ -1,15 +1,20 @@
library(hexSticker)
library(RColorBrewer)
library(magick)

# imgurl <- "http://www.constructalia.com/repository/transfer/it/resources/ContenidoProyect/05358730FOTO_AMPLIADA.jpg"

imgurl <- "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSUtUA4SwDMvXw8Y6zsa4EgH93VdpAkMrdpv67BmbeHPjgsqIvv"
plenary <- image_read(imgurl)
plenary_min <- image_crop(plenary, "270x179")
plenary_min_file <- file.path(tempdir(), "plenary_min.png")
image_write(plenary_min, path = plenary_min_file, format = "png")

sticker(
imgurl,
plenary_min_file,
package="GermaParl",
p_size = 7,
s_x = 1, s_y = 0.80, s_width = .64,
s_x = 1, s_y = 0.80, s_width = .66,
h_fill = "white",
h_color = "#004C93",
p_color = "#004C93",
Expand All @@ -25,7 +30,7 @@ sticker(
# l_height = 4
)

library(magick)

polmineR_sticker <- image_read('~/Lab/github/GermaParl/inst/sticker/hexsticker.png')
polmineR_sticker_min <- image_scale(polmineR_sticker, "130x150")
image_write(polmineR_sticker_min, path = "~/Lab/github/GermaParl/inst/sticker/hexsticker.png", format = "png")

0 comments on commit 54a2d01

Please sign in to comment.