ImgCompress: Image Compression

Description Usage Arguments Details Value Examples

View source: R/ImgCompress.R

Description

Image compression using different compression method. This function compress image to a user defined compression level.

Usage

1
ImgCompress(img, method, level = 1)

Arguments

img

m x n Image Matrix converted from package jpeg's function readJPEG().

method

Compression methods: Resize, SVD

level

Level of compression: 1-High, 2-Med, 3-Low

Details

SVD Method: SVD (Singular Value Decomposition) on RGB image. Note: Actual image memory size is not changed from this function. It does not handle the Jpeg compression algorithm

Resize: Resize image to different size using interval pixel selection method.

Value

The compressed image

Examples

1
2
img <- array(runif(1000),dim=c(10,10,3))
ImgCompress(img, method="resize", level=1)

UBC-MDS/ImgHelpR documentation built on Feb. 13, 2022, 2:20 a.m.