obskyr / colorgram.py

A Python module for extracting colors from images. Get a palette of any picture!
MIT License
451 stars 50 forks source link

Extract color coordinates #10

Closed mmoallemi99 closed 3 years ago

mmoallemi99 commented 3 years ago

Hi Colorgramers!

I intend to get the coordinate of each color in my image too, is there any way we can achieve this?

Any help is appreciated

DonaldTsang commented 3 years ago

There are many forms of coordinates for the same colors, e.g. RGB vs HSL vs HSV vs HSI vs HSY vs HCx vs YCbCr vs YCoCg.

mmoallemi99 commented 3 years ago

I didn't need color formats and systems, I needed the exact position (x, y) of a color.

DonaldTsang commented 3 years ago

Then you really shouldn't be using this, as color extraction of a single-pixel is better suited by other libraries, please check Pillow first. https://stackoverflow.com/questions/138250/how-to-read-the-rgb-value-of-a-given-pixel-in-python

A golden rule of Python: Know all of the popular library names by heart first, and treat the names like it is a sports car brand.

mmoallemi99 commented 3 years ago

I've used pillow before and solved my issue using Pillow and our custom algorithm, The point was that I wanted a perfect color palette extraction alongside pixel coordinates.

We've figured out our problem anyway so I guess we can close the issue.

Thanks for your time, <3

DonaldTsang commented 3 years ago

@mmoallemi99 it is okay to have multiple libraries mixed together, in that case.