panicinc / colorart Goto Github PK
View Code? Open in Web Editor NEWiTunes 11-style color matching code
iTunes 11-style color matching code
Error:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSGradient initWithColors:atLocations:colorSpace:]: the color NSNamedColorSpace System windowBackgroundColor cannot be converted into color space Generic RGB colorspace'
Does anyone know the purpose of the squaring step in -scaleImage:size:
? Specifically, Why does only a partial square portion of the image get used for the analysis instead of the whole image? This is a huge problem for thin and long images.
It seems that the algorithm you're using has a tough time picking out reds. I'm using your library to pick out colors for albums and here is the first example of something going not as expected.
The background color is pretty good. It could be a little darker to reflect that the album background isn't pure white. My main issue is with the primary color here. There are pretty much only two colors on the album, white and red. The red doesn't show up in any of the colors, be it primary, secondary, or detail color. In all of these examples, the colors are as follows:
Here's another example
The background color is a dark brown/green. Ideally it would be a red or a white as those are the two most dominant colors in the image and they also touch the borders.
Yet another example:
For this album cover, the background color is good. What's weird is that the primary color is pink. There isn't really pink on the album cover, though there is a bit of red in the reflection of the sunglasses. It would make more sense for the primary color to be a black, white or brown.
Moar example:
There should be red/magenta as the primary color.
Last example:
Nix the purple/lilac. Use the reds/oranges/light blues/blacks or whites. The background color should definitely be white here as that is also the background color of the album. Red or orange would work as well.
EDIT:
I found some more weird occurrences. In the following image, there shouldn't be any light blue.
In the following image, there should not be pink.
In the future, similar to Chris Banes's ColorFinder, it would be nice to have a secondary text color which is either black or white depending on the brightness of the background color to ensure high visibility/readability.
It'd be nice to have a standard set of images to test to make sure that the output looks the same after making changes to the program. The images from the blog post would be good ones to start with.
-findEdgeColor:imageColors:
relies on the image having a minimum size in order to work effectively. If the image is too small, there aren't enough repeated edge colors to get past randomColorsThreshold
. Furthermore, it might be a good idea to accumulate colors from the other edges, as well as to give the edge a certain pixel width. Finally, it's important for this method to return some color; after all, what does it mean for an image to have "no" background color?
Is it possible to make an iOS port of this component ?
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.