Page 1 of 1

Batch convert .psd and make background transparent.

Posted: 2015-11-20T05:20:42-07:00
by UnixNewbie
Hello All,

I am looking to batch convert 300 x .psd files. The resulting output needs to be:

300 x .psd files with the alpha channel made transparent
300 x .png - flattened.

All files need to retain their original names (prefix).

Example of that I have been trying to combine something like this: $ convert file.psd -flatten file.png

with something like this: $ convert *.psd -alpha opaque *.psd

As stated - only started learning this stuff a few weeks ago so apologies if the above seems stupid!

I have navigated to the correct directory in Terminal. My question is how can I combine these operations to batch convert the files and output the ne .psd and .png with the original file prefix.

Thanks in advance.


I am very new to Unix. Using Terminal in OSX. Have installed Brew and ImageMagick:

Version: ImageMagick 6.9.2-6 Q16 x86_64 2015-11-19 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib

Re: Batch convert .psd and make background transparent.

Posted: 2015-11-20T05:33:20-07:00
by snibgo
The resulting output needs to be: ... 300 x .psd files with the alpha channel made transparent

convert *.psd -alpha opaque *.psd
You say you want them transparent, but you make them opaque????

Re: Batch convert .psd and make background transparent.

Posted: 2015-11-20T05:38:18-07:00
by UnixNewbie
Ah sugar, there you go - first issue with being so new to this. I copied the wrong code across. I meant $ convert .psd -alpa transparent *.psd is what I mean. Sorry!

Re: Batch convert .psd and make background transparent.

Posted: 2015-11-20T05:38:35-07:00
by UnixNewbie
Ah sugar, there you go - first issue with being so new to this. I copied the wrong code across. I meant $ convert *.psd -alpha transparent *.psd is what I mean. Sorry! Thanks for taking the time to respond.

Re: Batch convert .psd and make background transparent.

Posted: 2015-11-20T06:48:04-07:00
by snibgo
Next problem:

Code: Select all

convert *.psd ...{etc}
This will read all the PSD files in the directory, holding them all in memory at the same time, and then write them out as ... well, I'm not sure what name it will give the single output file.

I guess you really want to change each PSD file, overwriting it. You could use one convert command per file, and name the file explicitly. Or use mogrify, but I know very little about that.

I'm not sure why you want to make each PSD file fully transparent. Nothing wrong with doing this, if that's what you really want. See http://www.imagemagick.org/script/comma ... .php#alpha

Re: Batch convert .psd and make background transparent.

Posted: 2015-11-20T07:10:26-07:00
by UnixNewbie
Hi Snibgo. Thanks, will have a look and come back to you maybe. Cheers!

Re: Batch convert .psd and make background transparent.

Posted: 2015-11-20T07:11:15-07:00
by UnixNewbie
No my apologies again. I want to fully remove the background from each .psd - leaving it transparent.