• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Exporting Each Layer from Illustrator Into Separate PNG Files

New Here ,
Mar 27, 2020 Mar 27, 2020

Copy link to clipboard

Copied

Hello community !

I am looking for a way to export individually each layer in Illustrator as PNG, JPG or any other format.

 

I've seen this video :
https://www.youtube.com/watch?v=_9MX2moFX4A

Featuring this script :
http://www.ericson.net/content/2011/06/export-illustrator-layers-andor-artboards-as-pngs-and-pdfs/?f...

 

But the script doesn't seem to work properly on my Illustrator CC 2020 version.

 

I know the "export asset" functions, as well as "save for screens" and "save for webs". But if you had a quick way to just tell Illustrator "Hey, take every individual layer existing, and export them into separate PNG files please".

It would be great for my workflow.
Thanks !

TOPICS
Bug , Feature request , Import and export , Scripting , Third party plugins

Views

44.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 27, 2020 Mar 27, 2020

Copy link to clipboard

Copied

Try this: MultiExporter.jsx

https://gist.github.com/TomByrne/7816376

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 17, 2022 Aug 17, 2022

Copy link to clipboard

Copied

No longer works in CC2022 (v26.5). Worked in 2020 when I last used it, not now.

It's absurd that exporting a PSD from Illustrator (or opening an .ai file in Photoshop) doesn't reliably preserve layers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

Not work in cc 2023

Any help !!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

What does not work for you? Works fine for me in 27.8.1

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

I want to export each group of each layer as a separate file instead of export whole Ai file to psd and then export as png or jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

The script does not export sublayers separately.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

Do you know any script to do that ?

Thanks in advance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

I am not aware of such a script.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 17, 2023 Aug 17, 2023

Copy link to clipboard

Copied

Thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Yes, tried this too. The script seem to be not updated for latest version of CCs 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Works for me, what may not be obvious at first, even if you don't want to export artboards, you have to select an artboard (to tell where the layers are).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

It works for me too, fantastic script for automation exports ! It really save my time !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 27, 2022 Oct 27, 2022

Copy link to clipboard

Copied

I believe I have the artboard selected, but alas, it still says "Will export 0/242 layers on Artboard 1".

 

Screen Shot 2022-10-27 at 1.10.17 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

I have the same issue, does not seem to work on 2023 Ai CC, something illustrator could add so easily 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

Do you use this version?

https://gist.github.com/TomByrne/7816376

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

Yes. It's the same version we've been talking about throughout this whole conversation. It's identified within the script as v0.6 dated 2013. It doesn't work. Doesn't show up in the Script menu if it's placed in Illustrator's Scripting folder, doesn't work if you just try running it direct from the file. If it's doing anything, it's failing silently. No dialogue box or error is displayed. And yes, I have layers/artboards selected.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

AI scripts are forward compatible.  Any script that worked in 2013 should work in 2023. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

And yet…

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 08, 2023 Sep 08, 2023

Copy link to clipboard

Copied

I made this today, it exports all layers for "Export for web" and at 1200px x 1200px, I'm sure you could alter it to your needs, but like you nothing was working for me. It wont let me upload a file with a .jsx but if you download visual code studio you can save the below text as .jsx 

 

// Define the export folder path (change as needed)
var exportFolderPath = "~/Desktop/ExportedImages/";

// Create the export folder if it doesn't exist
var exportFolder = new Folder(exportFolderPath);
if (!exportFolder.exists) {
exportFolder.create();
}

// Set the desired export size
var exportWidth = 1200;
var exportHeight = 1200;

// Get the current Illustrator document
var doc = app.activeDocument;

// Loop through layers
for (var i = 0; i < doc.layers.length; i++) {
var layer = doc.layers[i];

// Check if the layer is visible
if (layer.visible) {
// Hide all other layers
for (var j = 0; j < doc.layers.length; j++) {
if (j !== i) {
doc.layers[j].visible = false;
}
}

// Set the layer as the active layer
doc.layers[i].hasSelectedArtwork = true;

// Define export options for "Export for Web"
var exportOptions = new ExportOptionsPNG24();
exportOptions.transparency = true;
exportOptions.horizontalScale = exportWidth / doc.width * 100;
exportOptions.verticalScale = exportHeight / doc.height * 100;
exportOptions.artBoardClipping = true;

// Define the export file path
var exportFile = new File(exportFolderPath + layer.name + ".png");

// Export the layer using "Export for Web"
doc.exportFile(exportFile, ExportType.PNG24, exportOptions);

// Deselect all artwork
doc.layers[i].hasSelectedArtwork = false;

// Restore the visibility of all layers
for (var j = 0; j < doc.layers.length; j++) {
doc.layers[j].visible = true;
}
}
}

// Close the original document without saving changes (optional)
// doc.close(SaveOptions.DONOTSAVECHANGES);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 21, 2024 Feb 21, 2024

Copy link to clipboard

Copied

LATEST

You just need to be in an artboard selection mode, not the normal selector(V) mode.

Select the Artboard Tool then run the script and you will be good to go.

 

You welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines