Guide to creating your own Export Sizes sets

Export to Multiple Sizes has 3 default sets for Android, iOS and Adobe AIR but did you know you can also create your own export sets? Shown here at 1:19:

Previous Instructions:
http://www.velara3.com/wp/2015/01/22/export-to-multiple-sizes-for-photoshop/

INSTRUCTIONS

To add your own presets:

  1. Open the JSX (see video above) (make a back up before editing)
  2. Copy the code of one of the examples (shown below) and paste it in the Custom Preferences section
  3. Next add a line for each of the sizes you want
  4. Name your export settings in the customPlatforms object
  5. Save this file and run the script in Photoshop again. You will see your option in the pop up dialog. If nothing happens you may have a typo. Start over or check what you’ve typed.

Export options:

  • name is used to make the file name. if you use 100 for name then the final image will be yourimage_100.png
  • size is the destination size. if you enter 100 for size the image will be resized to 100 by 100
  • directory is the destination direction (optional). if you enter “assets” then the file will be saved to “assets/yourimage_size.png”
  • width and height are also options you can set when not resizing to a square. these override the size setting.
  • format sets the export format. (optional) more info below
  • preserveAspectRatio if true preserves the aspect ratio. (optional) default is true
  • quality sets the quality for some formats. (optional) default is 60 for jpeg
  • includeProfile includes the profile. (optional) default is false

Examples (4 examples):

Example 1:

MY_FLAPPY_BIRD_GAME_EXPORT_SIZES = [
		{"name": "Bird_1024", "size":1024},
		{"name": "Bird_512", "size":512},
		{"name": "Bird_128", "size":128},
		];

customPlatforms.push({"id": "myFlappyBirdGameScript", "name": "Flappy Bird Game Sizes", "options": MY_FLAPPY_BIRD_GAME_EXPORT_SIZES});

Example 2:

MY_FLAPPY_BIRD_GAME_EXPORT_SIZES2 = [
		{"name": "100", "size":100},
		{"name": "200", "size":200},
		{"name": "300", "size":300},
		{"name": "400", "size":400},
		];

customPlatforms.push({"id": "myFlappyBirdGameScript2", "name": "Flappy Bird Game Sizes 2", "options": MY_FLAPPY_BIRD_GAME_EXPORT_SIZES2});

Example 3:

MY_EXPORT_SIZES = [
		{"name": "Large", "width":400, "height":250},
		{"name": "Medium", "width":198, "height":124},
		{"name": "Small", "width":100, "height":60},
		];

customPlatforms.push({"id": "myExportScript", "name": "My Export Sizes", "options": MY_EXPORT_SIZES});

Example 4:

EXAMPLE_VARIOUS_EXPORT_OPTIONS = [
		{"name": "Bird_1024", "size":1024, "format":SaveDocumentType.JPEG},
		{"name": "Bird_1024_q10", "size":1024, "format":SaveDocumentType.JPEG, "quality":10},
		{"name": "Bird_1024_q100", "size":1024, "format":SaveDocumentType.JPEG, "quality":100},
		{"name": "Bird_1024_png_bcs", "size":1024, "format":SaveDocumentType.PNG, "resampleMethod":ResampleMethod.BICUBICSMOOTHER},
		{"name": "Bird_1024_png_nn", "size":1024, "format":SaveDocumentType.PNG, "resampleMethod":ResampleMethod.NEARESTNEIGHBOR},
		{"name": "Bird_512_png", "size":512, "format":SaveDocumentType.PNG, "includeProfile":true},
		{"name": "Bird_512_gif", "size":768, "format":SaveDocumentType.COMPUSERVEGIF, "includeProfile":true},
		{"name": "Bird_128", "size":128},
		];

customPlatforms.push({"id": "exampleOfVariousOptions", "name": "Example of Various Options", "options": EXAMPLE_VARIOUS_EXPORT_OPTIONS});

SOME REFERENCE

ResampleMethod (NONE is not supported):

  • BICUBIC
  • BICUBICSHARPER
  • BICUBICSMOOTHER
  • BILINEAR
  • NEARESTNEIGHBOR
  • NONE (not supported)

SaveDocumentType valid values are:

For the “format” property, only COMPUSERVEGIF, JPEG, PNG-8, PNG-24, and BMP are supported.
Note: PNG-8 and PNG-24 may both be specified as PNG
But difference may be saveForWeb.PNG8 = true or false. if false then save as 24 bits.

  • ALIASPIX
  • BMP
  • COMPUSERVEGIF
  • ELECTRICIMAGE
  • JPEG
  • PCX
  • PHOTOSHOP
  • PHOTOSHOPDCS_1
  • PHOTOSHOPDCS_2
  • PHOTOSHOPEPS
  • PHOTOSHOPPDF
  • PICTFileFORMAT
  • PICTRESOURCEFORMAT
  • PIXAR
  • PNG
  • PORTABLEBITMAP
  • RAW
  • SCITEXCT
  • SGIRGB
  • SOFTIMAGE
  • TARGA
  • TIFF
  • WAVEFRONTRLA
  • WIRELESSBITMAP

For more info on export options see Photoshop CS5 JavaScript Ref.pdf