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 "[email protected]" 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.jpg
quality (number in percent)
{quality:80} name_of_image.jpg
retina (boolean)
{retina:true} name_of_image.jpg
width (number)
{w:400} name_of_image.jpg
height (number)
{h:400} name_of_image.jpg
=======
basic
name_of_image.png
png8 (boolean) (exports a png8 image)
{png8:true} name_of_image.png
matte (hex color)
{matte:'#ff0000'} name_of_image.png
retina (boolean)
{retina:true} name_of_image.png
width (number)
{w:400} name_of_image.png
height (number)
{h:400} name_of_image.png
=======
basic
name_of_image.gif
matte (hex color)
{matte:'#ff0000'} name_of_image.gif
width (number)
{w:400} name_of_image.gif
height (number)
{h:400} name_of_image.gif
=======