I need to detect a color from particular image which i already selected.
@SrenivasanKanna
JDK
(Josef R.)
November 19, 2019, 8:51am
2
Hello there
I am not sure if UiPath is able to detect and output colorCodes.
However maybe you can use build-in activity: GET ATTRIBUTE
I have used it a few times myself - but only works, if the color is embedded in the img-filename.
Fx. img href=“ColorButtonGreen.gif”
Best of luck
Get attribute img-filename and check for color in filename (if possible)
@mahalakshmis02
There is no activity in UiPath to get color, we have custom package - color Detector - for getting color from web page or image.
https://go.uipath.com/component/colordetector-01cabc
Its only capturing the color based on x and y position. you can not get the color of mixing image color. only u can get the color which if fully occupied on the selection area.
Page for Ex.
opened 11:42PM - 28 Feb 18 UTC
closed 07:55AM - 21 Mar 18 UTC
### What did you do?
```python
from PIL import Image
from PIL import ImageFil… e
ImageFile.LOAD_TRUNCATED_IMAGES = True
im = Image.open('pic263134.jpg')
im.save('1.png')
```
### What did you expect to happen?
Image could be saved up to corruption point.
### What actually happened?
All black image is saved. Tried saving to different output formats - it's all black anyway.
![1.png](https://user-images.githubusercontent.com/2279051/36819127-dc9e33ea-1c9c-11e8-9a93-0d3c0a674f02.png)
### What versions of Pillow and Python are you using?
Python2. Pillow 5.0.0 and 3.0.0
Original image:
![original_image](https://user-images.githubusercontent.com/2279051/36819109-d04f6f32-1c9c-11e8-97cf-fc244d5aa5e3.jpg)
`djpeg` can output image correctly (up to corruption point)
Looks like it's problem with decoding step, since after opening, all image bands contain 0-only bytes:
```python
sum(im.split()[0].point(lambda x: 0 if x else 1).getdata())
# returns 3097440
```
stpes:-
properties:-
Get position
Get color from Web
Regards,
Srenivasan Kannan
1 Like
Hi @SrenivasanKanna ,
that link doesn’t work anymore, do you have any other option for someone who wants to detect a color in an image?