Preserving transparency in Photoshop batch operations

Member
Posts: 42
Joined: 2002.09
Post: #1
G'Day,

I have 72 sprites as PSD files, which I want to turn into a QuickTime-compatible format, preserving transparency. I had tried tiff, png and pdf, but Photoshop loses the transparency. Is there a workaround for this?

Visit http://www.theDailyGrind.net for your recommended daily intake of embittered satire.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
Works fine here. Let's go through the steps:

1) New doc, with transparent background.
2) Draw something.
3) Action palette>New Action.
4) File>Save For Web, choose PNG-24 and make sure Transparency is checked, save out.
5) Click stop in Action palette.

now test it:

1) Create or open doc with transparency.
2) Run the new action.
3) Open the resulting .png

Transparency is preserved for me. Note when you expand the action, it explicitly says "With Transparency" as one of the PNG settings.



Note, Photoshop (or any Carbon app) will NOT preserve the transparency of any image copy-pasted from a Cocoa app. This is a well known issue (apps generally look for PICT format data on the pasteboard, and drop the transparency.) It will preserve transparency if you open the file, instead of pasting.


Also, note that while PNG is probably the best general-purpose format, Cocoa has a stupid bug that makes the pixel values become slightly darker when you read in with NSImage.
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #3
arekkusu's suggestion is good, but this is another way of doing it if you prefer to work with alpha channels:
  • Select->Select Colour Range: Fuzziness 0, click on the transparent colour.
  • Channels Palette: click Save Selection As Channel.
Another way to do it (if you already have antialiased transparent edges on the layer):
  • Layers Palette: pick up the layer and drop it on the Add Layer Mask button.
  • Channels Palette: pick up the temporary layer mask channel and drop it on the Create New Channel button.
  • Layers Palette: Pick up the layer mask and throw it onto the trash button and press Apply to clean up.
You may need to select the new alpha channel and invert it. It's a good idea to stick the whole process into an action as well.

Since Adobe like to move all the controls around for every new version, this may be a little different if you're not using version 7!

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Member
Posts: 42
Joined: 2002.09
Post: #4
It's not saving individual files with transparency that's the problem... it's batch operations. For some reason Photoshop is opening the window, visibly discarding the transparency and then automatically saving and renaming. Maybe it's because I replaced photoshop's own png plug-in with SuperPNG?

Visit http://www.theDailyGrind.net for your recommended daily intake of embittered satire.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #5
Again, works fine here.

If I select the action I created in my previous post in the "Batch" dialog, choose the in and out folders, and override the save command, so that my Save For Web settings are used, transparency is preserved.


Have you tried Save For Web, or are you exporting as PNG, with a non-standard PNG plugin?
Quote this message in a reply
Member
Posts: 42
Joined: 2002.09
Post: #6
I am using Photoshop Elements 2.0, and I can't seem to find the "Actions" pallet?

Visit http://www.theDailyGrind.net for your recommended daily intake of embittered satire.
Quote this message in a reply
Member
Posts: 42
Joined: 2002.09
Post: #7
OK, I re-installed the original PNG plug-in, and transparency still doesn't work on batch operations.

Visit http://www.theDailyGrind.net for your recommended daily intake of embittered satire.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #8
Ah. Elements doesn't have Actions, last I checked (I worked on 1.0... never looked at 2...)

In that case, I'm not sure what to tell you, since Elements' batch functionality must be limited. You might be out of luck... there must be a Photoshop-centric board somewhere to ask on though, where you could get replies from more people using Elements.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #9
[Edit: misread your second post]

Hrmmph.
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #10
GraphicConverter is capable of interpreting Photoshop's transparency as an alpha channel (presumably provided you don't create a real alpha channel). It also has a batch converter, although I think you have to register to use it. Maybe that will do what you want.

[EDIT: Just tried it. The batch converter does the job nicely, retaining the transparency and everything, but it gives the resulting PNG files a .raw extension! Apart from that it's fine.]

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Photoshop sizing and dpi Chamse 5 8,919 Apr 13, 2011 10:35 PM
Last Post: Anomalous Interactive
  Photoshop Sprites With Alpha Channel Nick 22 17,989 Nov 26, 2006 06:25 PM
Last Post: jarfish
  Your favorite Photoshop tutorials Carlos Camacho 6 5,993 Nov 18, 2005 04:08 AM
Last Post: Fenris
  Photoshop transparency/alpha channels willman256 17 12,198 Oct 29, 2005 05:21 AM
Last Post: TomorrowPlusX
  Creating anti-aliased sprites in Photoshop Malarkey 9 11,007 Mar 7, 2005 09:52 PM
Last Post: arekkusu