Class: Colordom::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/colordom/image.rb

Overview

Image object implemented in Rust that extracts dominant colors.

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Image

A new instance of Image.

Parameters:

  • path (String, Pathname, File)

Raises:

  • (Error)

    if path is not a valid image



# File 'lib/colordom/image.rb', line 6

Instance Method Details

#histogram(max_colors) ⇒ Array<Color>

Get dominant colors using histogram quantization.

Parameters:

  • max_colors (Integer)

Returns:



# File 'lib/colordom/image.rb', line 12

#kmeans(max_colors) ⇒ Array<Color>

Get dominant colors using k-means clustering.

Parameters:

  • max_colors (Integer)

Returns:



# File 'lib/colordom/image.rb', line 22

#mediancut(max_colors) ⇒ Array<Color>

Get dominant colors using median cut quantization.

Parameters:

  • max_colors (Integer)

Returns:



# File 'lib/colordom/image.rb', line 17