Colorpalette from image: nice to have
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- julia
- Domain
- data-visualization
Research direction
Start with _assets/scripts/getColorPalette.jl and review the referenced Julia approach using Clustering, Colors, Random, and Images. Determine the appropriate built-in ColorSchemes API and dependency scope from that example. Done means ColorSchemes provides a supported way to obtain color palettes from images, with behavior matching the intended use case.
Written by the indexing model from the issue text.
Description
I do have this script to obtain colorpalettes from images (like the ones for Taylor Swift :D, https://twitter.com/drob/status/1459259255312236547 ). However, probably it will be nice to have a built-in function in ColorSchemes for this. Just in case this is of interest, here the relevant code (probably not the best approach, but it works).
using Clustering, Colors, Random
using Images: load, RGB, channelview, permutedims
function getColorPalette(image; ncolors = 5)
img_CHWa = channelview(image)
#img_CHW = permutedims(img_CHWa, (1,3,2))
testmat = reshape(img_CHWa, (3, size(image)[1]*size(image)[2])) #input shape
sol = kmeans(testmat, ncolors)
csize = counts(sol) # get the cluster sizes
colores = sol.centers # get the cluster centers, dominat colors
indxc = sortperm(csize)
colores, indxc
end
- Dominant language
- Julia
- Stars
- 268
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGraphics/ColorSchemes.jl
-
Colorcet NamingOpen
Difficulty 3/5 1-2 days Newbie friendliness 45/100
JuliaGraphics/ColorSchemes.jl#143 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
JuliaGraphics/ColorSchemes.jl#132 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 42/100
JuliaGraphics/ColorSchemes.jl#122 · 1 comment · 3 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
JuliaGraphics/ColorSchemes.jl#121 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 40/100
JuliaGraphics/ColorSchemes.jl#115 ·
All issues in JuliaGraphics/ColorSchemes.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Sienna-Platform/InfrastructureSystems.jl#675 ·
Maintainers usually reply within 2 days
-
TargetEncoder reuses the first level's shrinkage factor for all levels when m > 0Possibly taken @parth-patel010 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAI/MLJTransforms.jl#95 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
SciML/RecursiveArrayTools.jl#687 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
SciML/LinearSolve.jl#1412 ·
Maintainers usually reply within 8 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
SciML/Corleone.jl#179 ·
Maintainers usually reply within 1 day