Skip to content

tsuda16k/pictplot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pictplot

CRAN_Status_Badge CRAN_time_from_release CRAN_latest_release_date metacran downloads license

This is an R package that contains a lot of basic image processing functions.

Dependencies

Mac users need to install XQuartz (https://www.xquartz.org/).

Installation

This package is currently not available on CRAN. The development version of the package can be installed vie GitHub.

Installation via GitHub

You can install the development version of the pictplot package via GitHub, by using the devtools package.

# install the devtools package
install.packages("devtools")

NOTE:
To install a package from GitHub,

  • On Windows, Rtools needs to be installed.
  • On Mac, XCode may be needed to be installed.

After you have installed the required software stated above, install the package as follows:

# install the pictplot package
devtools::install_github("tsuda16k/pictplot")

Then, load the package.

library(pictplot)

Example image

The pictplot package includes an image data, which is useful when you want to see how a function works right away. The variable name of the image is regatta.

Internally, this is just a numeric array of size 450 x 600 x 3 [y-coordinate, x-coordinate, color channel], meaning that it is 450 pix height and 600 pix width, and has three color channels (Red, Green, and Blue). Each element of the array represents a pixel value, which can range between 0 and 1.

dim(regatta)
#> [1] 450 600   3

Image size information can be shown by typing the variable name.

regatta
#> image: 450 [height] x 600 [width] x 3 [colour channels]

To plot an image, use the plot() function.

plot(regatta)

Load an image

To load an image you like, use the im_load() function.

im = im_load("path/to/your/image.jpg")

The jpg, png, and bmp formats are supported.

You can load an image from the web (URL). For example,

im = im_load("https://raw.githubusercontent.com/tsuda16k/pictplot/master/notes/face.png")
plot(im)

will load an image of a face.

Functionality

WIP

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages