I was resizing some jpg images and found that my script resizes files differently than running the resize script manually.
1) I recorded a script that resized to 80% original.
2) I tested a Manual Resize using that script:
2a) I opened an 18 MB jpg file and clicked the "run" icon on the 80% resize script that was saved.
2b) I saved the result as jpg. --- It is 6.5 MB
3) I tested a Batch Resize using that same script:
3a) Open the Batch menu item and selected the 18 MB original file and the same 80% resize script used above,
3b) I ran the batch
3c) I checked the resultant file and find it is only 1 MB (compared to 6 MB if I ru nthe same script outside of a batch process)
Why?
Note that the pixel dimensions are the same for both results.
Here's the script detail that I used in both of these tests:
from PSPApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'PaintShop Pro',
'Host Version': u'16.00'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((16,0,0),1)
}
})
# Resize
App.Do( Environment, 'Resize', {
'AspectRatio': 1.50554,
'CurrentDimensionUnits': App.Constants.UnitsOfMeasure.Percent,
'CurrentResolutionUnits': App.Constants.ResolutionUnits.PixelsPerIn,
'Height': 80,
'MaintainAspectRatio': True,
'Resample': True,
'ResampleType': App.Constants.ResampleType.Bicubic,
'ResizeAllLayers': True,
'Resolution': 300,
'Width': 80,
'SharpnessValue': 50,
'AdvancedMode': False,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'DialogPlacement': {
'ShowMaximized': False,
'Rect': ((682,271), 489, 428)
},
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((16,0,0),1)
}
})
Batch Resize Results in Different Size Image than Script
Moderator: Kathy_9
-
ltjost
- Posts: 13
- Joined: Sat Aug 31, 2013 2:04 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Dell Inc. 0Y536R A15
- processor: 2.53 gigahertz Intel Core2 Duo 64 kilobyte primary
- ram: 8 gb
- Video Card: ATI Mobility Radeon HD 4670
- sound_card: AMD High Definition Audio Device
- Hard_Drive_Capacity: 750GB
- Monitor/Display Make & Model: Generic PnP Monitor
-
LeviFiction
- Advisor
- Posts: 6831
- Joined: Thu Oct 02, 2008 1:07 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Alienware M17xR4
- processor: Intel Core i7-3630QM CPU - 2_40GH
- ram: 6 GB
- Video Card: NVIDIA GeForce GTX 660M
- sound_card: Sound Blaster Recon3Di
- Hard_Drive_Capacity: 500GB
- Corel programs: PSP: 8-2023
- Location: USA
Re: Batch Resize Results in Different Size Image than Script
It's not your script, it's the save settings inside the batch process dialog.
Inside the Batch Process dialog Select "Save as new type," then next to the file type JPG select the Options button. Set the compression rate.
If you don't set the compression rate, or if you save over the original, X6 will save with a compression of about 20. Making it as small as possible.
Inside the Batch Process dialog Select "Save as new type," then next to the file type JPG select the Options button. Set the compression rate.
If you don't set the compression rate, or if you save over the original, X6 will save with a compression of about 20. Making it as small as possible.
https://levifiction.wordpress.com/
-
ltjost
- Posts: 13
- Joined: Sat Aug 31, 2013 2:04 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Dell Inc. 0Y536R A15
- processor: 2.53 gigahertz Intel Core2 Duo 64 kilobyte primary
- ram: 8 gb
- Video Card: ATI Mobility Radeon HD 4670
- sound_card: AMD High Definition Audio Device
- Hard_Drive_Capacity: 750GB
- Monitor/Display Make & Model: Generic PnP Monitor
