1

I'm trying to use a bunch of svg icons on something I'm designing. Photoshop doesn't process svgs, apparently. I read Illustrator does and that I can just export it into psds. That much is managable but the problem is there are 300+ icons and I thought I'd just turn them all into psds in case I ever need them in the future.

How exactly do I do that? I'm using the CS5 suite.

4
  • 2
    You do realize that converting an svg to a psd is actually a step backwards in terms of quality, right? "For the future" would lean towards maintaining the svg format and using newer applications.
    – Scott
    Commented Mar 1, 2015 at 18:02
  • You need to elaborate on what you want on you psds. Do you want a flattened pixel image of the svg or psd vector paths?
    – Naty
    Commented Mar 1, 2015 at 19:16
  • @Scott Why this should be "a step backwards"? Different types of medias support different file types - there are several reasons to rasterize a vector. The note should point out that an image can't edited like a vector.
    – p2or
    Commented Mar 2, 2015 at 13:58
  • 1
    Photoshop can't save true vector content so it's a step backwards.
    – Scott
    Commented Mar 2, 2015 at 18:17

2 Answers 2

2

I suggest to use Inkscape and your command line to convert it to a png, jpg or whatever. Following command converts a single svg file to a 1024x1024px png:

inkscape -z -e test.png -w 1024 -h 1024 test.svg

Inkscape has mighty command line options, with the -z argument you can run inkscape headless (without a gui). You only have to pass your disired image format, dimensions and image name. See the docs for more information.

To Batch process a folder of svgs you can use a programming language of your choice and iterate through the files. I've used linux with python 2.7+ (platform independent) here:

import os # import os module
import subprocess # import subprocess module to call inkscape with python

# set the path to your svg folder
path = '/home/user/Desktop/svgs'   # linux or osx 
# path = r'c:\some\directory\svgs' # windows, the r is important
# path = 'c:/some/directory\svgs'  # windows (alternative)

# collect all svgs in this folder
svg_files = [f for f in os.listdir(path) if f.endswith('.svg')] 

# iterate through the files
for i in svg_files:
    # setup correct filepath for inkscape
    file_path = os.path.join(path,i)
    # generate file the with a png extension
    png_path = os.path.splitext(file_path)[0] + '.png'
    # call inkscape with the correct arguments like in the example above 
    subprocess.call(['inkscape', '-z', '-e', png_path, '-w 1024', '-h 1024', file_path])

To convert a png or whatever to psd file use ImageMagick. The command is simple:

convert test.png test.psd

See the docs for more information. Batch process the png files to psd files via python again:

import os # import os module
import subprocess # import subprocess module

# set the path to your svg folder
path = '/home/user/Desktop/pngs'    # linux or osx
# path = r'c:\some\directory\pngs'  # windows, the r is important
# path = 'c:/some/directory\pngs'   # windows (alternative)

# collect all pngs in this folder
png_files = [f for f in os.listdir(path) if f.endswith('.png')] 

# iterate through the files
for i in png_files:
    # setup correct filepath for pngs
    file_path = os.path.join(path,i)
    # generate file the with a psd extension
    psd_path = os.path.splitext(file_path)[0] + '.psd'
    # call imagemagick with the correct arguments
    subprocess.call(['convert', png_path, psd_path])

Generated files are working for me in Photoshop CS4+.

Note: Converting the files in one iteration is also possible of course, but I thought for illustration purposes it's easier to split up the process.

1
  • So all the shapes and layers in the svg will be joined into one rasterized psd layer?
    – shuji
    Commented May 25, 2018 at 20:06
1

RabBits, I think right now no solution for SVG to Photoshop support, may be will come later. For the time solution you can open the file Illustrator-->File-->Export-->Format-->Photoshop (psd)-->OK.

enter image description here

Then you can open the file to Photoshop for edit.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.