skew: Adjust a graphic for fish-eye cameras

View source: R/finalise_newsroom2.R

skewR Documentation

Adjust a graphic for fish-eye cameras

Description

Squeezes the right-hand-side of an image to make it look normal on telly when filmed from a fish-eye camera.

Usage

skew(infile, outfile, across = 100, squeeze = 200, split = 0.5, bg = "#f5f5f5")

Arguments

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.

Details

You need to have Magick installed for this to work (the software, not the R package)

Examples

## 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)

bbcuffer/rcutils documentation built on Nov. 10, 2023, 12:08 p.m.