Skip to main content
Torugo Prando
Known Participant
January 16, 2014
Released

P: Generator: Create Folders in Image Assets

  • January 16, 2014
  • 22 replies
  • 1940 views

Hello! I'm loving the Adobe Generator for Photoshop and use it a lot!

A useful feature i'd like to see is to specify/create folders to save the assets. Something like:

folder/asset.png

It would be great to generate Android assets, when we have files with the same name, but in different folders (mdpi, hdpi, xhdpi, etc)

Thanks!

22 replies

Inspiring
December 1, 2014
This sounds very handy for situations where I want everything in my file to be duplicated and/or resized, but is not so useful when I'm in a situation where I would need the folders to contain something like:

android/
icon_36.png*
icon_72.png*
icon_92.png

iOS/
icon_29.png
icon_36.png*
icon_40.png*
icon_50.png
icon_72.png*
icon_76.png
icon_100.png

Newsletter/
icon_40.png*
icon_72.png*

Website/
icon_72.png*
icon_1024.png

*items with duplicate files in other locations

I don't want to litter my folders with unnecessary files. Plus, there are situations where I need two files that are different, but have the same name (ex. icons/square/icon72.png, icons/rounded/icon72.png).

For now, I've worked around this by naming files "icon72.png, _icon72.png, __icon72.png, ___icon72.png" and then cleaning up the underscores afterwards. Are there any other tricks I might be missing to help me get around this problem?
Inspiring
September 25, 2014
Michael, you can do that now, just not in the layer name for each asset you are exporting. See my answer below to use a "default" layer to save all of your assets to different folders.
Inspiring
September 25, 2014
Not sure about the fix that Pete Green is talking about, but you can do this now using the "default" layer technique to save multiple versions of the same asset.

Let's say you have a layer named "icon.png" in a file named "MyIcons.psd". That layer would get saved to the file "MyIcons-assets/icon.png". No problem.

But to save multiple versions of that file, for example for different resolutions of Android devices as mentioned above by Tirza, you can save that same "icon.png" file to different folders. You have to create an empty layer in MyIcons.psd and the first part of that layer name must be "default". This layer will tell Generator how to save all of the tagged layers in the document. Name your "default" layer like this:

default 100% android/res-hdpi/, 75% android/res-mdpi/

This will create two versions of "icon.png": "MyIcons-assets/android/res-hdpi/icon.png" (at the size it appears in your document, 100%) and "MyIcons-assets/android/res-mdpi/icon.png" (at 75% of the size since Android's MDPI density is 75% of HDPI). As long as you're indicating different folders in the "default" layer, you won't get the duplicate file name errors.

Also, if you're saving to different resolutions it seems best for your PSD file to use the highest resolution/density that you are supporting and to scale down from there, though if you are using mostly vector shapes you shouldn't have a problem.
Inspiring
September 8, 2014
This is a function I've been waiting for a long time. It would make Android app assets exports a lot easier and quicker!
Pete.Green
Community Manager
August 26, 2014
Thanks for the report Erin and Victor, We're aware of this and have a fix in hand. Stay tuned for future updates.
Torugo Prando
Known Participant
August 11, 2014
I'm having the same problem here 😕😕
Inspiring
August 11, 2014
I'm really enjoying the ability to put assets into different folders, but one problem I've been having lately is that I want to create multiple folders that contain the same file. Is there a way to do this without getting the "duplicate file name" error?
Inspiring
April 8, 2014
Hi Michael,

Good news! We have folder support in Generator slated for the next release of Photoshop. You can read about it here if you're interested:

https://github.com/adobe-photoshop/ge...

Also, we have a feature in the works to allow users to specify document-wide defaults -- feel free to comment on the syntax or suggest additional use cases:

https://github.com/adobe-photoshop/ge...

Best,
-- Joel
Michael Ahokas
Participant
April 8, 2014


The Generator in Photoshop CC is great. It would be even better if it allowed you to export assets to different folders. For example, say I have an icon and I want to generate 1x and 2x assets for iOS and 1x, 1.5x, 2x, 3x, and 4x assets for Android. I would like them to go to different folders (e.g. iOS, Android/hdpi, Android/xhdpi etc).

Currently it requires a bit of effort to sort stuff out after generating them. It would be nice if it were easier.

Perhaps it would be enough if you could add a path to the layer name so if you wanted to export icons in the following way:

ios/icon.png
ios/icon@2x.png
android/mdpi/icon.png
android/hdpi/icon.png
android/xhdpi/icon.png

you could name the layer like this:
ios/icon.png, 200%ios/icon@2x.png, android/mdpi/icon.png, 150%android/hdpi/icon.png, 200%android/xhdpi/icon.png
Inspiring
March 28, 2014
The page that Kyoko links to covers the work we've done to specify folders.

We're also working on document-wide defaults. You can find out more about that here: https://github.com/adobe-photoshop/ge...