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

Batch convert SVGs to PNGs

Community Beginner ,
Oct 01, 2020 Oct 01, 2020

Copy link to clipboard

Copied

Hello there,
is there a script to batch convert a folder full of SVGs to PNGs of a certain size?
I need to upscale 1000+ SVGs icons to 50x50px and convert them to PNG. 
I've tried to frankenstein together some scripts but they of course didn't work because i suck.

Any help would be greatly appreciated!

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

Views

11.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
Engaged ,
Oct 01, 2020 Oct 01, 2020

Copy link to clipboard

Copied

Will photoshop do something like that? I'm pretty sure it can open SVGs. Other than that I don't know. Sorry. 

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 ,
Oct 01, 2020 Oct 01, 2020

Copy link to clipboard

Copied

Good idea!

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 ,
Oct 01, 2020 Oct 01, 2020

Copy link to clipboard

Copied

OH just had another thought. If you can place them as images, put one on each artboard and then export artboards as individual files of the specified type. Not very graceful and still dang time consuming but would get the job done.

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 ,
Oct 01, 2020 Oct 01, 2020

Copy link to clipboard

Copied

Hi mystery_sk, it's great that you've had a go at cobbling together from scripts, but it's hard to know where the blockage is without more information. Perhaps you could explain the part of your frankenstein script that fails? Or the incorrect results you're getting.

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 02, 2020 Oct 02, 2020

Copy link to clipboard

Copied

This is achievable with a simple batch action assuming each icon is its own individual SVG file. Assuming thats the case and if the only thing you want to do is export each file as a 50x50 asset, open one of your SVG files and start recording a new action.

 

While recording:

- Click File > Export > Save for Web (Legacy)

- For file type, select PNG-24

- Enable transparency assuming thats what you want

- Under Image size, make the size of your export 50x50

- Click Save

- Choose the location where you want to save ALL of your exported PNG icons (make it different from where your SVGs are. Dont make it a subfolder in your SVG folder for reasons that will be clear later.)

- After the Save for Web window closes, click File > Close (because you made no changes to the file, it should close without asking to save)

- Stop Recording your action

- Rename your action to something like "SVG to PNG 50x50"

 

Now that you have an action that exports one SVG as PNG, you can do it for many at a time with Batching.

Before running a batch action, it's advised that you save and close any other work you have not only in Illustrator, but other applications as well. Once you have, you can run your batch process.

 

To run a batch process, from the Actions tab:

 

- Click the action you just created and click the hamburger menu in the top right corner of the Actions tab, then click Batch... at the bottom.

- Because you had your action selected, you should see the action already selected in the "Play" section of the Batch window.

- For the Source, you'll want to make sure the dropdown says "Folder" and then click Choose below it. This is where you'll select the folder where all your SVG icons are kept.

- If your SVG icons are categorized in subfolders, you'll need to make sure the checkbox "Include All Subdirectories" is enabled. This is where it is imperative that you double-check to make sure where you're saving your PNGs is not in the same folder as the SVGs or even a sub-folder in your SVG folder because if it is, you'll run into an infinite loop of exporting PNGs.

- For Destination, choose "None". This may seem wrong, but we've already decided where the Save for Web action would save the PNG. No need to save them again in the batching process.

- Click OK.

 

What you should see after starting the batch action is each file opening, exporting the PNG to the specs listed above, and then closing itself. It should be obvious to note that this will happen for each SVG file in your folder, so if you have over 1000 icons to export, be prepared to wait a while until it's done. But in the end, you will have saved yourself quite a bit of time.

 

Hope this helps.

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 Beginner ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

This doesn't work at all on illustrator 2021.

Everytime it asks to insert dimensions and the file name.

There is also no way to stop the full batch process. You need to force quit.

I need to batch export from svg to 1600px width png and it seems a crazy task to do. It seems impossible to belive that it's not easy.

 

The same problems are in photoshops. You cannot use Photoshop batch process since it always ask for dimensions when trying to open the file.

 

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 23, 2021 Sep 23, 2021

Copy link to clipboard

Copied

It seems they won't fix or apply a way to auto-set dimensions on SVG file on Photoshop for batch actions. This is ridiculous. It's already boring when needing to work with 5 or 10 svg files. Imagine so when you need convert a set of 1360 icons… and all we needed is a way to say "hey I want all these SVG files to open with X and Y size pls"

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 ,
Nov 21, 2023 Nov 21, 2023

Copy link to clipboard

Copied

LATEST

Brilliant! Thank you!

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
Advocate ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

 

 

Bonjour Mystery_sk!

J'ai édité le script qui exécute le travail demandé...

https://share.orange.fr/#q3J1wm1GZ2738f0215a

me faire parvenir quelques exemples de fichier svg.

PS Je travail avec la version CS6 Illustrator

René

 

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
Advocate ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

Pardon,

Je n'avais pas importé le bon fichier png

https://share.orange.fr/#vtQokAtZmhe3513770f

René

 

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
Explorer ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

have you try recording action in illustrator to use in batch.

like resize image canvas to A4, resize art to canvas height and resize to required dimension .

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