Code Monkey home page Code Monkey logo

colorcube's People

Contributors

fikus avatar insidegui avatar mattbierner avatar notoroid avatar pixelogik avatar richrad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colorcube's Issues

CocoaPods integration

Hello,

First: Congrats for the work you've done! This is a great feature. I'll only suggest that you could create a CocoaPods for this library... this makes things a lot easier to integrate :)

Thanks.

Can I get the image Dominant color before its 'Downloaded from URL'

Hello Developer,

Really nice library may say appreciate your work on the algorithm implemented.

I have a query like google Image in Iphone is you Check , if you scroll very fast for the search images grid, the first time you see a background of the most dominent color and then the actual image.

I want to implement the same behaviour, hence Can you please recommend if this can be done in this library or any reference.

I dont want to download an image of 3MB then show the dominent color for the second and then actual image rather it should show the dominent color while loading and then the actual image.

Can you advice.

Python: Order by brightness

Thanks for this great implementation! Could you give a hint how to implement the missing sort-by-brightness functionality in the Python version? Cheers, :M:

javascript port

Ole!

I like your algorithm more than any of the existing in-browser tools for color extraction, so I made a javascript port.

Great work on ColorCube! The port would have been a lot harder without your super-clean code. πŸ’ž

Type Error for certain image (Python)

For the image https://somafm.com/img3/defcon-400.png, I get the following TypeError when using ColorCube.py:

➜  Python git:(master) βœ— python3 ./ColorCube.py /tmp/defcon-400.png
Traceback (most recent call last):
  File "./ColorCube.py", line 305, in <module>
    colors = cc.get_colors(image)
  File "./ColorCube.py", line 126, in get_colors
    m = self.find_local_maxima(image)
  File "./ColorCube.py", line 152, in find_local_maxima
    r = float(p[0])/255.0
TypeError: 'int' object is not subscriptable

Later find pixel belongs to which color segment

Hi,
I need to replace the pixel colors of the image by output 4 colors.
Here how do I find a particular pixel belongs to which color segment? What would be the calculation.

Thanks
deshan

GContextDrawImage: invalid context 0x0

CGContextDrawImage: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Certain method always produces error

Hi,

First of all, this is a rad library! Thanks!

I'm finding that whenever I use this particular method, I get an error that crashes the app:

- (NSArray *)extractColorsFromImage:(UIImage *)image flags:(NSUInteger)flags avoidColor:(UIColor*)avoidColor;

This happens avoiding either black or white. The error:

-[UIDeviceRGBColor red]: unrecognized selector sent to instance 0x7f86c8eab8e0

Outside of this small issue, I've found this lib works perfectly.

no compability with iOS12

Hey! using your framework in jailbreak tweaks cause springboard to crash entirely. Any plans on updating it?

Wrong dominant color for transparent images (Python)

Hi,

for the image https://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/NDR_Info_Logo.svg/1280px-NDR_Info_Logo.svg.png I get the following (wrong) output:

[0, 0, 0] [0, 50, 101] [255, 194, 0] [121, 92, 0]

Obviously there are no black pixels whatsoever in this image – it looks like the fully transparent pixels are getting count. How does your program deal with alpha values? Can we teach it to ignore them or – perhaps better – take the alpha value into account for the pixel representation?

ColorCube returns unexpected color

Give the provided image, I would expect a return of a "bluish" color.

But the first color returned is the dark gray on the side, #7b7573

Is this a bug, or is this the correct return and I am misunderstanding the intent of the algorithm? It definitely seems the case that most images with this little bit of dark gray will end up choosing it. I am aware of the avoidColor/avoidDim, etc... alternatives, but i'm wondering if those "workarounds" should be necessary.

Thanks! and thanks for your code!

code:

    UIImage* image = [UIImage imageNamed:@"badDominantColor2.png"];
    CCColorCube* colorCube = [[CCColorCube alloc] init];
    NSArray* imgColors = [colorCube extractColorsFromImage:image flags:0];
    UIColor* dominantColor = imgColors[0];
    NSLog(@"color:%@", dominantColor.hexString);  // use your favorite hexString category

image:
baddominantcolor2

Suggestions for perf improvement on small images?

Hi, I was just wondering if there was something relatively simple I could do to increase performance when using small images as input.

I'm not saying that ColorCube isn't performant. But i am calling it many times, and was just wondering if perhaps for small images there is something obvious. Like "oh, you really don't need to do x passes, or this data structure could be smaller, or if your images are that small just do it yourself like this"

Essentially, I am almost exclusively working with 10x10 images and looking for only the first dominant color.

thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.