Script to take sample color from image
Posted: Sat May 20, 2017 1:37 pm
Heya, I hope someone has a solution to this... as that would save weeks of work...
So I have 50k+ images that I need a sample size colour from the image. In other words, I have an image with a t-shirt and I need 50x50 size image of that t-shirt colour. I could record a script to take a sample 50x50 size from the middle of canvas but not everything is placed in the middle of the image. So what I would need first:
1. To find an AVERAGE colour in the canvas (minus WHITE 255 255 255).
2. Set coordinates for that average colour and take 50x50 size sample around that AVERAGE pixel.
3. Save + Close
Sounds simple when you put in words... but... not in practice
So I have 50k+ images that I need a sample size colour from the image. In other words, I have an image with a t-shirt and I need 50x50 size image of that t-shirt colour. I could record a script to take a sample 50x50 size from the middle of canvas but not everything is placed in the middle of the image. So what I would need first:
1. To find an AVERAGE colour in the canvas (minus WHITE 255 255 255).
2. Set coordinates for that average colour and take 50x50 size sample around that AVERAGE pixel.
3. Save + Close
Sounds simple when you put in words... but... not in practice