Script to take sample color from image

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Freedox
Posts: 1
Joined: Sat May 20, 2017 1:29 pm

Script to take sample color from image

Post by Freedox »

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 :)
User avatar
txuku
Posts: 136
Joined: Thu Jan 01, 1970 12:00 am

Re: Script to take sample color from image

Post by txuku »

Bonjour

Hum................



Difficult to apprehend ...............

Can you explain us with pictures? :)
iMatt
Posts: 3
Joined: Fri Sep 22, 2017 8:13 pm

Re: Script to take sample color from image

Post by iMatt »

I agree that we may need some images that illustrate your problem more clearly. But I thought I would point out that you don't need a script to generate the average color of the canvas you can simple go to Filter>Blur>Average, and this will generate the average color of the document.