how to change r,g,b color to 2 coordinates in python?
<pre><code>from PIL import Image

picture = Image.open("C:/Lab/photos/frog2.png")
r,g,b = picture.getpixel( (0,0) )
print("Red: {0}, Green: {1}, Blue: {2}".format(r,g,b))
</code></pre>

<p>the result is Red: 57, Green: 66, Blue: 19
but i want to change this r,g,b to 2 coorinates like(x,y)</p>

<p>what should i type?</p>

<p><a href="https://github.com/gtaylor/python-colormath" rel="nofollow"><code>colormath</code></a> can be used to convert a RGB color to a xyY color, and from there you can simply ignore the Y coordinate in order to get a xy chromacity.</p>

python python-2.7 coordinates rgb dimensions