jackieh / palette-pick Goto Github PK
View Code? Open in Web Editor NEWColor picker and color scheme manager.
License: GNU General Public License v3.0
Color picker and color scheme manager.
License: GNU General Public License v3.0
I saw the results of the hue spread method are not noticeably different from a random spread. I followed this in the code and found a likely bug.
Before being passed into find_clusters
, sample_colors
is initialized with get_hue_spread_colors
. But sample_colors
is an output parameter that is cleared by find_clusters
, meaning the initialization changes nothing.
palette-pick/src/lib/image.cpp
Lines 107 to 130 in a34485a
palette-pick/src/lib/color_k_means.cpp
Line 21 in a34485a
After profiling, removing the lines reserving space gives a 2.4x speed increase in the getcolors tool.
palette-pick/src/lib/image.cpp
Lines 74 to 76 in a34485a
Instead of partitioning the canvas into separate rectangles to fill, this loop fills progressively smaller overlapping rectangles. This results in the loop being quadratic to the number of pixels rather than linear.
After profiling, making the loop linear results in an 8.8x speedup in the mkstripes program.
palette-pick/src/lib/stripes_image.cpp
Lines 70 to 89 in a34485a
Because color_centroids
was cleared before the loop, size
will always be zero so c
will never be less than.
The rest of the loop initializes all matrix elements to zero. armadillo offers a zeros
function to return a zero matrix directly. That should be used instead of eye
.
palette-pick/src/lib/color_k_means.cpp
Lines 24 to 36 in a34485a
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.