COPs get the dominant colors of an image.
2416 12 0- probiner
- Member
- 339 posts
- Joined: June 2013
- Offline
There's Quantize COP but I don't want to divide the existing pixels by predefined ranges, instead I would like to extract the dominant colors of an image like Kuler (Adobe Color) does:
Or when a Color Table is generated from an image in Photshop:
Or ImageMagik -colors x:
But I'm unsure about how to go about this. I can see the histogram in the Composite View, but not sure how would I cluster them and sort by occurence:
Am I missing some straight forward way to do this?
Thanks
prb
Or when a Color Table is generated from an image in Photshop:
Or ImageMagik -colors x:
But I'm unsure about how to go about this. I can see the histogram in the Composite View, but not sure how would I cluster them and sort by occurence:
Am I missing some straight forward way to do this?
Thanks
prb
Edited by probiner - Dec. 16, 2021 19:32:11
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Hi Probiner,
not sure whether this is acceptable for your workflow but I have used the cluster point SOP for this.
not sure whether this is acceptable for your workflow but I have used the cluster point SOP for this.
Edited by Konstantin Magnus - Dec. 17, 2021 08:45:00
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- probiner
- Member
- 339 posts
- Joined: June 2013
- Offline
Konstantin Magnus
Hi Probiner,
not sure whether this is acceptable for your workflow but I have used the cluster point SOP for this.
Thanks. I've looked into and I'm noticing that while it does an interesting job at posterizing, the issue I notice with a lot of solutions is that once you lower the amount of "buckets" is when you start to see some issues:
I would expect blue to be dominant while reducing the number of clusters but seems that red gets the cake.
With Adobe Color I also don't get the "importance" of each swatch.
I've been using Attribute Promote Median or Mode but I was looking for something that would offer a more "statistical analysis approach", eheh...
Edited by probiner - Dec. 16, 2021 21:24:24
- Aizatulin
- Member
- 475 posts
- Joined: July 2005
- Offline
Hi,
maybe you calculate some attributes for each cluster and use these attributes to sort the clusters. You can take for example the deviation on a cluster. If this value is low, the colors are close together. If you decrease the number of clusters, this value will probably raise and gives less good approximation. Here is an example (modification of Konstantins file).
maybe you calculate some attributes for each cluster and use these attributes to sort the clusters. You can take for example the deviation on a cluster. If this value is low, the colors are close together. If you decrease the number of clusters, this value will probably raise and gives less good approximation. Here is an example (modification of Konstantins file).
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Ok, I assume you have already checked the fuse SOP then.
Edited by Konstantin Magnus - Dec. 17, 2021 08:45:31
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- probiner
- Member
- 339 posts
- Joined: June 2013
- Offline
Aizatulin
Hi,
maybe you calculate some attributes for each cluster and use these attributes to sort the clusters. You can take for example the deviation on a cluster. If this value is low, the colors are close together. If you decrease the number of clusters, this value will probably raise and gives less good approximation. Here is an example (modification of Konstantins file).
Interesting addition! It's actually interesting to look at the "streaks" of color when you do @P = @Cd ; and you can almost see the clusters very clearly then. Thanks for the file!
Konstantin MagnusI didn't and you're very right, I should have tried, ehehe That looks great, really. I guess it didn't come to mind because one will not set the amount of buckets but a Threshold. Thanks for the file!
Ok, I assume you have already checked the fuse SOP then.
Cheers
prb
- jsmack
- Member
- 7771 posts
- Joined: Sept. 2011
- Online
probinerAizatulin
Hi,
maybe you calculate some attributes for each cluster and use these attributes to sort the clusters. You can take for example the deviation on a cluster. If this value is low, the colors are close together. If you decrease the number of clusters, this value will probably raise and gives less good approximation. Here is an example (modification of Konstantins file).
Interesting addition! It's actually interesting to look at the "streaks" of color when you do @P = @Cd ; and you can almost see the clusters very clearly then. Thanks for the file!Konstantin MagnusI didn't and you're very right, I should have tried, ehehe That looks great, really. I guess it didn't come to mind because one will not set the amount of buckets but a Threshold. Thanks for the file!
Ok, I assume you have already checked the fuse SOP then.
Cheers
prb
Something to try would be doing the snapping in a different color space, rather than linear rgb. Maybe try Lab or Y'uv?
- probiner
- Member
- 339 posts
- Joined: June 2013
- Offline
jsmackprobinerAizatulin
Hi,
maybe you calculate some attributes for each cluster and use these attributes to sort the clusters. You can take for example the deviation on a cluster. If this value is low, the colors are close together. If you decrease the number of clusters, this value will probably raise and gives less good approximation. Here is an example (modification of Konstantins file).
Interesting addition! It's actually interesting to look at the "streaks" of color when you do @P = @Cd ; and you can almost see the clusters very clearly then. Thanks for the file!Konstantin MagnusI didn't and you're very right, I should have tried, ehehe That looks great, really. I guess it didn't come to mind because one will not set the amount of buckets but a Threshold. Thanks for the file!
Ok, I assume you have already checked the fuse SOP then.
Cheers
prb
Something to try would be doing the snapping in a different color space, rather than linear rgb. Maybe try Lab or Y'uv?
Yeah I did try that, although I didn't try with snapping since the values in other spaces can be very wild, so I retook Magnus setup with the clustering and tried a few color spaces with the function ctransform() in VEX. I've found HSV one is broken, so I already reported the bug.
Scene attached for example. I liked the results I got with Lab and hsl on my images.
Still not COPs, but hey..
Cheers
prb
Edited by probiner - Dec. 17, 2021 14:55:54
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
If you absolutely need COPs, I read numpy does clustering, too.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Btw. I found fusing and Lab to be alright.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- probiner
- Member
- 339 posts
- Joined: June 2013
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
The nearpoint()-function can also be used to index colors ie. based on a reference image.
Edited by Konstantin Magnus - Dec. 19, 2021 10:34:34
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- probiner
- Member
- 339 posts
- Joined: June 2013
- Offline
-
- Quick Links