How to Export Layers of a Photoshop (.psd) file Individually with GIMP [Ubuntu 19.10 Guide]
Today’s post is a rather specific how-to. I started receiving asset files from my artist in Photoshop format (.PSD) and all the assets were included in the same file (picture below). To use the assets in my game in Unity, I needed to get each one as a separate .PNG or compatible sprite format. Before asking my artist to give me individual sprites, I thought I’d do a bit of research myself.
GIMP is a great cross-platform photo editing tool. What I like the most about it that it is FREE and open source and has a plethora of tools, filters and plugins to work with. It can open .PSD files but not export individual layers to their own files.
After a bit of googling I came across a plugin for GIMP that does exactly what I wanted!
If you are not a Linux user, then following the installation guide for that plugin is all I will offer here. I hope you get up and running without any issues on Windows and Mac.
As is still typical with Linux distributions, there were a few bumps to set things up on my Ubuntu 19.10. The plugin wouldn’t load initially… but after an hour I had everything figured out. Let’s dive into how to get the plugin running in GIMP and export individual layers from our files!
Prerequisites
A bit of background I learnt on GIMP plugins. They can be written with different scripting extensions. The one above is written with GIMP-Python. To be able to run these types of plugins you need:
- python
- GIMP with pyGimp “module”
I installed both through apt
.
$> sudo apt install python
...
$> sudo apt install gimp gimp-python
...
That installs GIMP 2.10.8 with support for python plugins. Make sure you install the gimp-python
package there and not just GIMP.
To double check your version of GIMP has GIMP-Python module, look for the “Filters -> Python-Fu -> Console” menu. If you see it, then you are all set to install the plugin.
The Plugin Itself
The installation guide for the plugin should work from here onward. In short:
- Figure out the plugin directory for GIMP:
a) Open “Edit -> Preferences” menu.
b) Expand the “Folders” list item in the left panel.
c) Click on the “Plug-ins” item.
d) Take note of the plugin directories. Any of them will work. - Download the latest release of the plugin from here and extract the contents.
- Copy the contents into your plugin directory (from step 1).
At this point you should be good to go.
Usage
The plugin adds a new menu item: “File -> Export Layers…”.
- Click “File -> Export Layers…”
- Select the export format, i.e. png, and optionally directory to export to.
- Press Export.
Now you should see many individual .PNG files in the folder that you chose.