image_to_scaled: Scale an image raster array to a small number of pixels

View source: R/image-to-prep-mosaic.R

image_to_scaledR Documentation

Scale an image raster array to a small number of pixels

Description

Decrease the size of an image, in pixel. Process into a data frame. Internal function.

Arguments

image

A raster array from an image.

img_size

Size of output image in pixel, where one pixel = one 'brick'. Use a single value (e.g. 48) for a square image with 48 pixels on each side. Use an array of two values for a rectangular image c(width, height).

brightness

A value >1 will increase the brightness of the image while a positive value <1 will decrease the brightness.

warhol

Array of values c(1, 2, 3) associated with R, G, B color channels. Swap values in array to swap color channels for a fun visual effect.

Value

A list with element Img_scaled containing a data frame of the x- & y-coordinates, R, G, B channels, and hex color of each brick (pixel).


ryantimpe/brickr documentation built on Jan. 15, 2024, 10:29 p.m.