joelcarlson / rimagepalette Goto Github PK
View Code? Open in Web Editor NEWCreate a representative palette from an image.
Home Page: https://github.com/joelcarlson/RImagePalette
License: Other
Create a representative palette from an image.
Home Page: https://github.com/joelcarlson/RImagePalette
License: Other
This is a big problem!
It seems that ggplot2::discrete_scale()
calls the palette (RImagePalette::image_pal()
) twice, once for the colors on the plot, and once for the legend. Since there is some randomness in median cut, this often results in a different palette, and thus different colors.
Yikes.
Need to set the seeds properly somewhere in image_pal
I just tried this out and according to the image_palette()
documentation, you have to hand the function an image matrix from readJPEG()
or similar.
I didn't already have the jpeg
package installed and had to install it manually. As far as I can tell, there is no way to create the color palette without reading an image into an object first. If so, should the package make sure jpeg
is installed?
If yes, I'm happy to make a small pull request with the change to the DESCRIPTION file.
Other than that, the color palette and examples in the README are great. This will be useful ๐ .
Currently, the implementation of median cut is in R, and uses lists. This is not efficient as every time you modify a list in R it is copied.
Converting this to C++ would greatly speed up the process. Would also allow use of push and pop, which are missing from R lists.
Output palettes are not always particularly vibrant. An option to convert to a more attractive colorspace would be nice.
That is, in the median cut algorithm cut across LAB space, rather than RGB space.
eg.
x <-hex2RGB(lifeAquaticPalette)
as(x,"LAB")
https://cran.r-project.org/web/packages/colorspace/colorspace.pdf
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.