Possible? Batch action, select a colour and delete


#1

I have a bunch of clip art that is centered on a white background.

I want to select the white background, delete it (make transparent) and then save back to GIF.

Now, every single pic I have (and there are thousands) has a white background, so is it possible to script something something like this:

  1. Open file
  2. Select colour/magic wand based on colour value of pixel at location 0,0
  3. Delete the selected colour (white)
  4. Save as GIF with transparency

Cheers


#2

I’m not sure that will work,or I should say I never tried it. I did once make an action (a droplet) that deleted a background I didn’t like (from a folder of images), dropped in a transparent background and saved each image as transparent PNG files. It could probably work for saving as Gifs also.
Why not duplicate the image files (so you don’t mess up the originals) and give it a try?


#3

How did you go about selecting/deleting the background automatically?

I should also say I am using CS3.


#4

I deleted it when recording the Action.


#5

Ahhh, okay, it seems this is all possible with actions.

When you use the magic wand tool, it records the location of where you sample. To then crop the image to size (getting rid of white space) you just invert the selection and “crop”

So the action set basically goes:

Open file
Select magic wand at 1,1
Delete
Invert Selection
Crop
Save As GIF

I am impressed that the Actions could handle that so easily


#6

Question on the side: why are you using GIF?

Another option to remove the white background without using the magic wand tool is to use the blending options in the layer style dialog to remove white, convert layer to flattened version.


#7

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.