Package 'makePalette'

Title: Make Palette
Description: Functions that allow you to create your own color palette from an image, using mathematical algorithms.
Authors: Jorge L. C. Musaja [aut, cre]
Maintainer: Jorge L. C. Musaja <[email protected]>
License: GPL-3
Version: 0.1.2
Built: 2025-02-19 03:13:26 UTC
Source: https://github.com/musajajorge/makepalette

Help Index


Make your color palette with the CLARA algorithm

Description

Creates a color palette from an image, using the CLARA (Clustering Large Applications) algorithm

Usage

makePaletteCLARA(photo, n = 4)

Arguments

photo

Image location path. It can also be a URL address.

n

Number of elements to be generated in the color palette. The default value is 4.

Value

A palette of colors

Examples

makePaletteCLARA(system.file("extdata", "picture02.jpg", package="makePalette"))
makePaletteCLARA(system.file("extdata", "picture04.png", package="makePalette"), 6)
makePaletteCLARA(system.file("extdata", "picture05.jpg", package="makePalette"), 10)
MyPalette = makePaletteCLARA(system.file("extdata", "picture05.jpg", package="makePalette"), 10)
barplot(1:10, col=MyPalette)

Make your color palette with KMeans algorithm

Description

Creates a color palette from an image, using the KMeans algorithm

Usage

makePaletteKM(photo, n = 4)

Arguments

photo

Image location path. It can also be a URL address.

n

Number of elements to be generated in the color palette. The default value is 4.

Value

A palette of colors

Examples

makePaletteKM(system.file("extdata", "picture02.jpg", package="makePalette"))
makePaletteKM(system.file("extdata", "picture04.png", package="makePalette"), 6)
makePaletteKM(system.file("extdata", "picture05.jpg", package="makePalette"), 10)
MyPalette = makePaletteKM(system.file("extdata", "picture05.jpg", package="makePalette"), 10)
barplot(1:10, col=MyPalette)