convert: Convert one type of image to another

Description Usage Arguments Details

View source: R/convert.R

Description

Types are "raster","url","path","array3","matrix","long". See details

Usage

1
2
3
convert(img, to = c("raster", "url", "path", "array3", "matrix", "long"),
  from = c("auto", "raster", "url", "path", "array3", "matrix", "long"),
  path = NULL)

Arguments

img

object to convert

to

type of output, defaults to raster

from

type of input, guessed by default

path

for to = "path"

Details

raster is a two dimensional raster object, the format of the output of most tweak functions.

url is the url to fetch, png, tif, jpg, webp and svg are supported. Converting to url means uploading to imgur as PNG. To upload you'll need an account, follow instructions when trying for the first time. You can convert url to url, it's not a real copy though as it will convert to png.

path is the path to fetch, converting to path means saving. By default you save to a temp file. You can convert path to path

array3 is a numeric three dimensional raster object, that we get when importing the files

matrix is a character two dimensional matrix containing rgba colors in hex

long is a numeric matrix with 4 columns (rgba) and a DIM attribute


moodymudskipper/tweak documentation built on May 20, 2019, 8:49 a.m.