imtopix: Convert Image to Pseudo Pixel Art

Description Usage Arguments Copyright Notice Performance Issue Examples

View source: R/imtopix.R

Description

Convert image to pseudo pixel art by reducing the resolution of the image and matching the colour with a colour palette.

Usage

1
2
3
4
5
6
imtopix(
  im,
  blockSize = 8,
  pal = c("appleii", "atari2600", "commodore64", "contra", "gameboy", "grayscale",
    "hyrule", "intellivision", "kungfu", "mario", "nes", "sega", "tetris")
)

Arguments

im

an image; a cimg object, normally loaded by imager::load.image().

blockSize

numeric; the size of single pixel or block.

pal

character; colour palette used in matching.

Copyright Notice

This algorithm is a reduced version of a python script written by Nathan Harper. The intention of this package is to provide an R API of this algorithm. The author of this R package do not own the copyright of this algorithm. Please check the initial source of this algorithm https://github.com/nathanharper/phixelgator and Nathan Harper's Github page https://github.com/nathanharper for more details.

Performance Issue

R takes noticeable time to run this algorithm. If you would like to save your time, please use Nathan Harper's original script written in Python https://github.com/nathanharper/phixelgator.

Examples

1
2
# im <- sample_im
# imtopix(im, pal = "appleii")

TengMCing/im2pix documentation built on Feb. 2, 2021, 11:43 a.m.