View source: R/finalise_newsroom2.R
skew | R Documentation |
Squeezes the right-hand-side of an image to make it look normal on telly when filmed from a fish-eye camera.
skew(infile, outfile, across = 100, squeeze = 200, split = 0.5, bg = "#f5f5f5")
infile |
the png you want to squeeze |
outfile |
where you want to save the output |
across |
how many pixels you want to shove it to the right |
squeeze |
how many pixels you want to squeeze the RHS in by. Half will be taken off the top and half off the bottom. |
split |
how much of the 'squeeze' pixels are taken at the top. Default makes for a 50:50 split. Defined in the range 0-1. |
bg |
the background colour you want to use to fill in any blank space created. |
You need to have Magick installed for this to work (the software, not the R package)
## Not run:
## shift everything 100 pixels left, take 100 off the top
## and 100 off the bottom.
skew("file1.png", "file2.png")
## shift everything 100 pixels left, take 150 off the top
## and 50 off the bottom.
skew("file1.png", "file2.png", split = .75)
## shift everything 200 pixels left, take 75 off the top and 75
## off the bottom.
skew("file1.png", "file2.png", across = 200, squeeze = 150)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.