At first I loaded a photo *.jpg image with a size of 2072 kb into PSP and executed the script (shown at the bottom) directly from script toolbar.
The script is simple: Just resize, saturate, sharp and save
The result is a file of size 1455 KB.
Fine so far.
Now I went in PSP to menu File-->Batch process, then browsed to a copy of the original *.jpg photo file, then selected
the mentioned script from the drop-down and finally clicked on "Start" button.
Much to my surprise the resulting file has only a size of only 493 KB!
Why? Shouldn't it be the same resulting file size as direct execution for loaded pic?
Does Batch processing of a script use another compression factor as processing for loaded pictures?
Is there a way to set the compression factor as function directly in script file?
Thank you
Peter
Code: Select all
from PSPApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'Paint Shop Pro Photo',
'Host Version': u'12.01'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((12,0,1),1)
}
})
# Resize
App.Do( Environment, 'Resize', {
'AspectRatio': 1.33333,
'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Pixels,
'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerIn,
'Height': 1440,
'MaintainAspectRatio': True,
'Resample': True,
'ResampleType': App.Constants.ResampleType.Bicubic,
'ResizeAllLayers': True,
'Resolution': 300,
'Width': 1920,
'SharpnessValue': 50,
'AdvancedMode': True,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((12,0,1),1)
}
})
# Color Adjust HSL
App.Do( Environment, 'ColorAdjustHSL', {
'HSL': {
'Colorize': False,
'Master': (0,12,0),
'MasterColorize': (0,0,0),
'Red': (0,0,0,315,345,15,45),
'Green': (0,0,0,75,105,135,165),
'Blue': (0,0,0,195,225,255,285),
'Cyan': (0,0,0,135,165,195,225),
'Magenta': (0,0,0,255,285,315,345),
'Yellow': (0,0,0,15,45,75,105)
},
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((12,0,1),1)
}
})
# Sharpen
App.Do( Environment, 'Sharpen', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((12,0,1),1)
}
})
# FileSave
App.Do( Environment, 'FileSave', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.AllAlways,
'Version': ((12,0,1),1)
},
'DefaultProperties': []
})
