Description Usage Arguments Value Examples
View source: R/compression_perrrfect.R
The function can be applied to a greyscale or colour image. The user passes a cimg type object (from the imager package) which is to be compressed and the resulting compressed cimg object is returned. The user can also specify the pooling algorithm to be used and the size of the kernel to apply over the image.
1 | compression_perrrfect(img, kernel_size = 2, pooling_function = "max")
|
img |
A cimg type object of 4 dimensions representing a greyscale or colour image. |
kernel_size |
The size of the length and width of the kernel to be passed over the image. Default: 2 |
pooling_function |
The pooling algorithm to be used. Three options: "max", "min", and "mean". Default: "max" |
A cimg type image of 4 dimensions representing a greyscale or colour image.
1 2 | img <- imager::as.cimg(imager::boats)
compression_perrrfect(img, kernel_size=2, pooling_function="max")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.