Batch Process Cropping

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
WVMontani
Posts: 20
Joined: Fri Sep 08, 2017 3:18 pm
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit

Batch Process Cropping

Post by WVMontani »

I have a whole bunch of images that are 1920x1080 in size. The subject of each image is centered in the middle and is only about 500 pixels wide.

I would like to crop all of the images to 500x1080; starting at 710-0 and extending to 1210-1080; in other words, just keep the middle 500 horizontal pixels.

Is there a way to do this using the Batch Processing feature? Or some other way?

TIA.

-WVMontani
Andy2011
Posts: 115
Joined: Sun Sep 22, 2019 4:26 pm
operating_system: Windows 11
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte A520M S2H
processor: AMD Ryzen 5 PRO 4650G 6 Core CPU
ram: 16 GB
Video Card: Integrated Radeon Vega GPU
sound_card: on board
Hard_Drive_Capacity: 2500 GB
Monitor/Display Make & Model: BENQ GW2760HS + Benq T905 as second monitor
Corel programs: Aftershot Pro 3, Paint Shop Pro 2020
Location: UK

Re: Batch Process Cropping

Post by Andy2011 »

I suggest recording a macro (script) which can then be used in batch mode.
The process to get the script is
  • load a typical photo
    select 'crop' then adjust the selection to what you want (but don't activate the crop at this point)
    click on the macro record command (either red button on the tool bar, if shown, or File/Script/Start Recording)
    click on the tick symbol to complete the crop
    click on Save Recording (or File/Script/Save Recording) and give it a suitable name e.g. crop-500
Note - don't save the cropped file within the recorded script.
With the batch process, select the photos, under batch actions, choose 'Script' and select the newly saved recording script (e.g. crop-500). The output setting lets you rename the pictures.
I have done a quick test and it worked for me, so good luck!

Scripts are quite flexible and, if you know Python, you can write them to apply changes (e.g. crop size and position) based on information in the original photo such as original width and height.
Knowledge is recognising that a tomato is a fruit: experience is not putting it in a fruit salad.
WVMontani
Posts: 20
Joined: Fri Sep 08, 2017 3:18 pm
operating_system: Windows 7 Professional
System_Drive: C
32bit or 64bit: 64 Bit

Re: Batch Process Cropping

Post by WVMontani »

OK, that worked but two of your instructions were in the wrong order.

I have to start recording the script BEFORE I make my selection; not after making the selection. Then I click on the tick symbol to complete the crop. Then save the recording.

Thank you very much!

-WVMontani
Andy2011
Posts: 115
Joined: Sun Sep 22, 2019 4:26 pm
operating_system: Windows 11
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Gigabyte A520M S2H
processor: AMD Ryzen 5 PRO 4650G 6 Core CPU
ram: 16 GB
Video Card: Integrated Radeon Vega GPU
sound_card: on board
Hard_Drive_Capacity: 2500 GB
Monitor/Display Make & Model: BENQ GW2760HS + Benq T905 as second monitor
Corel programs: Aftershot Pro 3, Paint Shop Pro 2020
Location: UK

Re: Batch Process Cropping

Post by Andy2011 »

WVMontani wrote:OK, that worked but two of your instructions were in the wrong order.

I have to start recording the script BEFORE I make my selection; not after making the selection. Then I click on the tick symbol to complete the crop. Then save the recording.

Thank you very much!

-WVMontani
I understand what you are saying but that's not my experience. The script only remembers the settings of the crop tool at the time of executiong the command, not the way you get there. The key part of the script is:

Code: Select all

    # Crop
    App.Do( Environment, 'Crop', {
            'CropRect': ((710,0), 500, 1080), 
            'Mode': App.Constants.CropMode.Custom, 
            'Units': App.Constants.CropUnits.Centimeters, 
            'SelectedArea': False, 
            'PrintWidth': -1, 
            'PrintHeight': -1, 
            'CropAsNewImage': False, 
            'RotationAngle': -0, 
            'AutoFit': False, 
            'GeneralSettings': {
                'ExecutionMode': App.Constants.ExecutionMode.Default, 
                'AutoActionMode': App.Constants.AutoActionMode.Match, 
                'Version': ((22,0,0),1)
                }
            })
Anyway, it worked for you so that is the main thing.
Knowledge is recognising that a tomato is a fruit: experience is not putting it in a fruit salad.
Post Reply