Sorry for the new topic but I spent more than hour to find the answer but no luck.
The quest is simply: How can I get and set the color of a pixel in a document? I tryed:
tell application "Adobe Photoshop CS3"
tell current document
select region {{0, 0}, {0, 1}, {1, 0}, {1, 1}}
set a to color value of selection
end tell
end tell
It’s not working. I tryed a lots of combination without any results.
Thanks.
p.s.: If the answer here, please link it! Maybe I used wrong keywords.
I don’t have CS3 or CS4 so I have no way to confirm that this would even compile. I only got the manual as PDF to see what was new.
The position of the sampler is read only so it looks like you need to script making a new one then read that.
tell application "Adobe Photoshop CS3"
tell current document
set My_Sampler to make new color sampler at beginning with properties {class:color sampler, positon:{100, 100}}
set My_Values to color sample color of color sampler 1
end
end tell
tell application "Adobe Photoshop CS3"
tell current document
set My_Sampler to make new color sampler with properties {class:color sampler, position:{10, 10}}
set My_Values to color sampler color of My_Sampler
delete My_Sampler
end tell
end tell
“delete My_Sampler” because the max. samplers is 4.
For CS2 you need to create a 1 pixel selection as in the first post then read the histogram for each of your channels looking for the value of 1 in the 256 item list (that is if you image is 8 bits per channel) what colour space is your image? Do you need RGB as 0-255 or CMYK as %