jtp101
asked on
Detecting guides in photoshop script
I need to automate the processing of about 2500 product images and I think scripting Photoshop is the best way to do it.
For each image I need to:
1) Straighten it
2) Crop it leaving a set amount of space around the bounding box of the product
3) Fade from the edge of the product's bounding box to the edge of the image, going from the current background colour (almost white) to white
I am hoping to do this as follows:
1) A human opens each image, straightens it and defines the bounding box of the product using guides (I think that's what they are called - they blue lines you drag in off the side rules using the move tool) and saves the image.
2) A script opens up each image and, using the canvas size and the size and location of the bounding box, crops and adds the fades to the image.
This should be *much*faster than getting someone to do it all by hand, and also gives me the option to re-run the batch processing later if I want to change one of the parameters.
Is this a workable solution? Can I detect the guides in a Photoshop script? If not, can you think of an alternative method of recording the specification of the bounding box of each product so that a script can access it?
I considered creating another layer and drawing a rectangle over the bounding box of the product for example, and then getting the script to detect the edges of the rectangle...
I dont have any experience scripting Photoshop, I just want to make sure that what I am trying to do is possible before starting out!
We sell Single Malt Scotch Whisky (all the images are whisky) so if anyone feels like writing the script for me we might be able to come to an arrangement involving a few bottles of the good stuff ;-)
Cheers,
Justin
Image-0245.jpg
For each image I need to:
1) Straighten it
2) Crop it leaving a set amount of space around the bounding box of the product
3) Fade from the edge of the product's bounding box to the edge of the image, going from the current background colour (almost white) to white
I am hoping to do this as follows:
1) A human opens each image, straightens it and defines the bounding box of the product using guides (I think that's what they are called - they blue lines you drag in off the side rules using the move tool) and saves the image.
2) A script opens up each image and, using the canvas size and the size and location of the bounding box, crops and adds the fades to the image.
This should be *much*faster than getting someone to do it all by hand, and also gives me the option to re-run the batch processing later if I want to change one of the parameters.
Is this a workable solution? Can I detect the guides in a Photoshop script? If not, can you think of an alternative method of recording the specification of the bounding box of each product so that a script can access it?
I considered creating another layer and drawing a rectangle over the bounding box of the product for example, and then getting the script to detect the edges of the rectangle...
I dont have any experience scripting Photoshop, I just want to make sure that what I am trying to do is possible before starting out!
We sell Single Malt Scotch Whisky (all the images are whisky) so if anyone feels like writing the script for me we might be able to come to an arrangement involving a few bottles of the good stuff ;-)
Cheers,
Justin
Image-0245.jpg
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't believe you have access to the guides via scripting. At least for JavaScript that is.
I don't have time at the moment to write the script, even though it isn't that difficult. So if someone else wants to jump in, please do. If no one else can, I'll try to see if I can get to it later (tonight, maybe?)
I don't have time at the moment to write the script, even though it isn't that difficult. So if someone else wants to jump in, please do. If no one else can, I'll try to see if I can get to it later (tonight, maybe?)
ASKER
If you could put a script together or recomend someone who could I would be very grateful.
ASKER
Do you know anyone who would be able / interested in writing the script to handle the images once the selection has been saved? I can pay in Whisky or, if needs be, cold hard cash.
Out of interest, do you know that detecting the guides wouldnt work or did the alpha channel method just seem like a nicer way to do it?