https://github.com/juliaimages/colorquantization.jl
Color Quantization Algorithms in Julia
https://github.com/juliaimages/colorquantization.jl
colorquantization image-processing julia
Last synced: 12 months ago
JSON representation
Color Quantization Algorithms in Julia
- Host: GitHub
- URL: https://github.com/juliaimages/colorquantization.jl
- Owner: JuliaImages
- License: mit
- Created: 2022-09-21T07:48:16.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T13:27:46.000Z (over 1 year ago)
- Last Synced: 2025-06-24T22:16:58.816Z (12 months ago)
- Topics: colorquantization, image-processing, julia
- Language: Julia
- Homepage:
- Size: 1000 KB
- Stars: 7
- Watchers: 7
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ColorQuantization.jl
[](https://juliaimages.github.io/ColorQuantization.jl/stable/)
[](https://juliaimages.github.io/ColorQuantization.jl/dev/)
[](https://github.com/JuliaImages/ColorQuantization.jl/actions/workflows/CI.yml?query=branch%3Amain)
[](https://github.com/JuliaTesting/Aqua.jl)
[](https://codecov.io/gh/JuliaImages/ColorQuantization.jl)
A Julia package to generate color palettes from images.
## Installation
To install this package and its dependencies, open the Julia REPL and run
```julia-repl
julia> ]add ColorQuantization
```
## Examples
To extract a color palette from an image, call `quantize` with a [quantization method][docs-methods] of your choice.
```julia
using ColorQuantization
using TestImages
img = testimage("peppers")
quantize(img, KMeansQuantization(256)) # quantize to 256 colors
quantize(img, UniformQuantization(8)) # quantize to an 8x8x8 grid
```
The generated color schemes can be [viewed in the documentation][docs-getting-started].
## Related packages
[ColorSchemeTools.jl](https://github.com/JuliaGraphics/ColorSchemeTools.jl) provides `extract` to generate weighted colorschemes from images using K-means clustering.
[docs-getting-started]: https://juliaimages.org/ColorQuantization.jl/dev/generated/getting_started/
[docs-methods]: https://juliaimages.org/ColorQuantization.jl/dev/api/#methods_api