Last active
December 16, 2015 17:23
-
-
Save lm913/8b6cd6ab37dd2bd4170a to your computer and use it in GitHub Desktop.
Benchmarking script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target Photoshop | |
app.bringToFront(); | |
var docRef = app.activeDocument; | |
var doc = activeDocument; | |
var Res= 72 | |
var Width= 1000 | |
var Height= 1000 | |
for (var b = 0; b < 10; b++) { | |
doc.backgroundLayer.duplicate(); | |
}; | |
app.activeDocument.resizeImage(UnitValue(Width,"px"), UnitValue(Height,"px"), UnitValue(Res,"px"), ResampleMethod.AUTOMATIC); | |
app.activeDocument.convertProfile( "sRGB IEC61966-2.1", Intent.RELATIVECOLORIMETRIC, true, true ); | |
doc.flatten(); | |
SaveTIFF(app.activeDocument, app.activeDocument.path) | |
doc.close(SaveOptions.SAVECHANGES); | |
function SaveTIFF(doc, saveFile){ | |
var tiffSaveOptions = new TiffSaveOptions(); | |
tiffSaveOptions.byteOrder = ByteOrder.MACOS; | |
tiffSaveOptions.embedColorProfile = true; | |
tiffSaveOptions.layers = true; | |
tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW; | |
tiffSaveOptions.layerCompression = LayerCompression.RLE; | |
doc.saveAs(saveFile, tiffSaveOptions, false, Extension.LOWERCASE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment