how to get the index of a pixel color from an image?

335 views
Skip to first unread message

antia...@gmail.com

unread,
Nov 22, 2014, 11:26:24 PM11/22/14
to python_in...@googlegroups.com
hi.
how to get the index of a pixel color from an image?
example.... i have this image:"d:\test.pnj"

Justin Israel

unread,
Nov 23, 2014, 6:24:34 AM11/23/14
to python_in...@googlegroups.com
Can you explain what you want to do in more detail? What image and what do you mean by the "index"?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/58e025fd-9f65-4298-b843-c1565502f05c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

antia...@gmail.com

unread,
Nov 23, 2014, 8:24:57 AM11/23/14
to python_in...@googlegroups.com, antia...@gmail.com
excuse me....my question:..how to Get Pixel Information of on Image....
Chiefly!...how can I get the RGB values of a pixel, if I have the (x,y)coordinates of the pixel?...(pixel value from 'd:\test.pnj' file(example))

Matt Estela

unread,
Nov 23, 2014, 8:46:25 AM11/23/14
to python_inside_maya
colorAtPoint? It's a step further than you need in that it samples from the uv coord of a shape and returns a colour, but still, if you mat your image to a basic shader then the shader to a plane, it should cover what you require.




On 24 November 2014 at 00:24, <antia...@gmail.com> wrote:
excuse me....my question:..how to Get Pixel Information of on Image....
Chiefly!...how can I get the RGB values of a pixel, if I have the (x,y)coordinates of the pixel?...(pixel value from 'd:\test.pnj' file(example))
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1c9cf0f1-97e8-4ff4-86d1-5c169d66b990%40googlegroups.com.

Matt Estela

unread,
Nov 23, 2014, 8:47:10 AM11/23/14
to python_inside_maya
mat=map, damn my dyslexic fingers... ;)

Justin Israel

unread,
Nov 23, 2014, 2:10:05 PM11/23/14
to python_inside_maya
I wasn't sure if this was specific to Maya and textures, or a general question of how to read and inspect an image.
Matt is covering it from the Maya-specific angle. And if you meant a general approach, there are image libraries that can do it as well, such as OpenImageIO.

Reply all
Reply to author
Forward
0 new messages