PhotoshopForums.com Home
Navigate Contact FAQ Search Members
Ahhh... Help. Need to automate selection of 100s of similar
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> Actions and Automation
 See a User Guidelines violation? Please contact us.
Author Message

damian5000

Joined: 16 Jun 2013
Posts: 3



PostPosted: Sun Jun 16, 2013 4:34 am    Post subject: Ahhh... Help. Need to automate selection of 100s of similar Reply with quote

I have hundreds of avatars created with avatar software. Unfortunately it stupidly adds a website name, tons of space and a shadow under the avatar. All of which I want to remove.

The image sizes are all the same, however also unfortunately the location of the shadow, the website name and space around the avatar all change based on the size of the avatar.

I need a way to automate grabbing just the avatar (no space, no text, no shadow) and saving it.

What I need is an action or script that can select out to the edges of the avatar...Example, automate starting with a small selection box and have it expand until it hits the edges, then copy selection and save.

Or possibly a script/action that will select everything except for the exact color of the shadow and website text. I'm not sure which is the better method or which is easier, or if the first method is even possible without tons of scripting. Also, the second method could potentially not select colors within the avatar that are the same as the shadow or text colors....

I've attached 2 samples. Any ideas to automate this?
View user's profile Send private message

damian5000

Joined: 16 Jun 2013
Posts: 3



PostPosted: Sun Jun 16, 2013 7:17 am    Post subject: Reply with quote

Okay... I figured it out after about 3 hours of trial and error. It's not perfect, but it should work very well for 95% of the images.

I used color picker to remove the shadow. Before using color picker, I selected the bottom 1/5th of the image (even if some shoes were included... This was necessary because the avatars are of different lengths and wanted to make sure I caught the shadow in all images). I didn't select the whole image because this would select parts of the avatar as well with color picker. Obviously something may still be caught in some of the avatars shoes if grey, but with my test images, it wasn't a problem.

Refine edge and expand a bit to catch the whole area of shadow. Perhaps smart edge detection would be a better choice, Fill color-picked selected shadow with white.

Select bottom area where website name is and fill with white. This MAY be an issue too with the very tall avatars, some of their feet may get cut off, but so far no issue with the test images I've used.

Select white with magic wand, and clear. necessary because the background is white, not transparent and want transparent background.

inverse selection

Crop

Reduce size

Save

.... Haha... Anyone has a better way... Please let me know. I goofed around for so long before refining it to this... It seems very good so far....and was damn near giving up.
View user's profile Send private message

SCTRWD

Joined: 20 Jul 2011
Posts: 79



PostPosted: Sun Jun 16, 2013 10:02 am    Post subject: Reply with quote

Don't give up, try this

To get rid of site name:
1. Image->Trim... (Bottom right pixel color, trim away Bottom side)
2. Image->Canvas size, relative - check. Height - -30px, Vertical - top.
Again Image->Trim... (Bottom right pixel color, trim away Bottom)

Now to get rid of the shadow:
1. Flip Vertical
2. Magic Wand at 400 px, 5 px
3. Select->Modify-Expand: 4px,
4. Fill selection with white,
5. Deselect,
6. Flip Vertical,
7. Image->Trim... (Bottom right pixel color, trim away all sides)
View user's profile Send private message

thehermit

Joined: 05 Mar 2003
Posts: 3987
Location: Cheltenham, UK


PostPosted: Sun Jun 16, 2013 1:57 pm    Post subject: Reply with quote

All hail the new code nerd! ;)

(Paul!!!!) Big Grin

_________________
If life serves you lemons, make lemonade!
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PhotoshopForums.com Forum Index -> Actions and Automation All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Contact - User Guidelines >

Copyright © 2003-2016. PhotoshopForums.com, iFroggy Network. All Rights Reserved.
Powered by phpBB © phpBB Group. phpBB SEO. Privacy Policy.
We are in no way affiliated with Adobe. Photoshop, Adobe and related marks are registered trademarks of Adobe.
PhotoshopForums.com