Converts Layer names to optimized web images automatically ( currently only supports CS6 )
Turns a photoshop layer named: "{retina:true}logo.mini.png" into a transparent web optimized PNG named "logo.mini.png" and creates 2x retina version named "logo.mini@2x.png" in a folder that you specify... All with correct dimensions and flattened layers styles.
Layer name into image! Behold!
Download export_NameToFile.jsx
- Close Photoshop if it is open.
- Copy the script and its ‘Scripts Only’ folder to the Scripts folder in your Photoshop installation directory. (Warning: I have yet to test this script outside of CS6, but hey, it might work, give it a try.)
- On Windows: C:\Program Files\Adobe\Photoshop CS[x]\Preset\Scripts.
- On a MAC : Applications > Photoshop CS[x] -> Presets -> Scripts.
- Open Photoshop.
- The script will now appear on the File > Scripts menu and can be run from here at any time.
Below are the options you can add to the layer name for finer control of the exported image. Each example is showing one parameter but note that you can add as many applicable parameters as you want, per layer name.
basic
name_of_image.jpgquality (number in percent)
{quality:80} name_of_image.jpgretina (boolean)
{retina:true} name_of_image.jpgwidth (number)
{w:400} name_of_image.jpgheight (number)
{h:400} name_of_image.jpg=======
basic
name_of_image.pngpng8 (boolean) (exports a png8 image)
{png8:true} name_of_image.pngmatte (hex color)
{matte:'#ff0000'} name_of_image.pngretina (boolean)
{retina:true} name_of_image.pngwidth (number)
{w:400} name_of_image.pngheight (number)
{h:400} name_of_image.png=======
basic
name_of_image.gifmatte (hex color)
{matte:'#ff0000'} name_of_image.gifwidth (number)
{w:400} name_of_image.gifheight (number)
{h:400} name_of_image.gif=======
