Module: Colordom
- Defined in:
- lib/colordom.rb,
lib/colordom/color.rb,
lib/colordom/error.rb,
lib/colordom/image.rb,
lib/colordom/version.rb
Overview
Module that extracts dominant colors from images using native extension implemented in Rust.
Defined Under Namespace
Constant Summary collapse
- VERSION =
'1.1.0'
Class Method Summary collapse
-
.histogram(path, max_colors = 5) ⇒ Array<Color>
Get dominant colors using histogram quantization.
-
.kmeans(path, max_colors = 5) ⇒ Array<Color>
Get dominant colors using k-means clustering.
-
.mediancut(path, max_colors = 5) ⇒ Array<Color>
Get dominant colors using median cut quantization.
Class Method Details
.histogram(path, max_colors = 5) ⇒ Array<Color>
Get dominant colors using histogram quantization.
25 26 27 28 |
# File 'lib/colordom.rb', line 25 def histogram(path, max_colors = 5) image = Image.new(path) image.histogram(max_colors) end |