PSP version of place image

Moderator: Kathy_9

Post Reply
lalee
Posts: 2
Joined: Tue Nov 08, 2022 8:08 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit

PSP version of place image

Post by lalee »

I need a way to efficiently crop and resize a lot of images to the same specifications.
In PhotoShop I often used the place option to insert an image into a new layer another image one and then either resize or reposition the image into the preferred canvas size.
In PSP I can paste into a selection but then the image aspect ratio changes/distorts or I can paste as new layer but if the image I'm pasting is larger than the one I'm pasting into, it has to be resized to fit and that can be time-consuming.
Perhaps I'm just missing something, but even my google searches have come up empty.
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
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: PSP version of place image

Post by LeviFiction »

I don't believe so. Though it sounds easy enough to script. As soon as I finish another project. It just needs to open an image as layer, and use the resize command set to percentage to scale it to the correct width or height. Just needs a little math is all. Not much to it.
https://levifiction.wordpress.com/
JoeB
Posts: 2778
Joined: Fri Mar 28, 2008 10:04 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: LENOVO 4524PE4 ThinkCentre M91p
processor: 3.10 gigahertz Intel Quad Core i5-2400
ram: 8 GB
Hard_Drive_Capacity: 4.6 TB
Corel programs: PSP 9, X7 to 2019, 32 & 64-bit
Location: Canada

Re: PSP version of place image

Post by JoeB »

LeviFiction wrote: Wed Nov 09, 2022 2:20 am I don't believe so. Though it sounds easy enough to script. As soon as I finish another project. It just needs to open an image as layer, and use the resize command set to percentage to scale it to the correct width or height. Just needs a little math is all. Not much to it.
I'm not the OP, but "not much to it" for you would be waaayy beyond my capabilities with hand written Python scripting - AND the math involved! :-)
Regards,

JoeB
Using PSP 2019 64bit
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
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: PSP version of place image

Post by LeviFiction »

The math is the easiest part. Not even joking. It's simple percentages. Here's an example that will resize any layer to fit within the parent canvas and maintain it's aspect ratio.

Step 1: Grab the layer rectangle size
Step 2: Grab the canvas size
Step 3: Determine the longest side of the layer (default to width side if they are equal)
Step 4: Determine the shortest side of the canvas (default to width if they are equal)
Step 5: Divide short side by long side to get resize percentage
Step 6: Because the Resize command is weird about resizing layers, multiple the canvas width and height by the percentage calculated, and round to the floor to get the closest whole number
Step 7: Use the resize command with these new sizes, set "Resize all layers" to false so it only resize the currently selected layer.

I'm attaching that script, so it won't "Place" the image as a new layer. But if you open an image as a new layer and then run this script it'll quickly do the resizing for you, using the SmartSize method in the resize command. Much cleaner than using the pick tool to scale.

The "Open As Layer" script can also be quickly edited to do this exact same thing after it's finished opening the image as a layer. So it wouldn't take much to make the full script.
Attachments
FitLayerToCanvas.zip
(963 Bytes) Downloaded 84 times
https://levifiction.wordpress.com/
Kathy_9
Site Admin
Posts: 2896
Joined: Tue Nov 30, 2010 12:44 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
processor: 8th Generation Intel Core i7 8700 3 20 GHz
ram: 16GB
Video Card: NVIDIA GeForce RTX 2060 [6 GB GDDR6 dedicated]
sound_card: NVIDIA High Definition Audio
Hard_Drive_Capacity: 2TB
Monitor/Display Make & Model: HP EliteDisplay E243m 23.8-inch
Corel programs: PSPX2 ~2023; Painter 2018~23
Location: USA
Contact:

Re: PSP version of place image

Post by Kathy_9 »

Moved to PSP Scripting Sub-Forum.
PSPX9 | PSP2020 | PSP2021| PSP2022 | PSP2023 & PhotoMirage installed; PSPX | PSPX2 thru PSP2019 owned but not installed
http://www.flickr.com/photos/37153430@N03/
lalee
Posts: 2
Joined: Tue Nov 08, 2022 8:08 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit

Re: PSP version of place image

Post by lalee »

LeviFiction wrote: Wed Nov 09, 2022 6:54 am The math is the easiest part. Not even joking. It's simple percentages. Here's an example that will resize any layer to fit within the parent canvas and maintain it's aspect ratio.

Step 1: Grab the layer rectangle size
Step 2: Grab the canvas size
Step 3: Determine the longest side of the layer (default to width side if they are equal)
Step 4: Determine the shortest side of the canvas (default to width if they are equal)
Step 5: Divide short side by long side to get resize percentage
Step 6: Because the Resize command is weird about resizing layers, multiple the canvas width and height by the percentage calculated, and round to the floor to get the closest whole number
Step 7: Use the resize command with these new sizes, set "Resize all layers" to false so it only resize the currently selected layer.

I'm attaching that script, so it won't "Place" the image as a new layer. But if you open an image as a new layer and then run this script it'll quickly do the resizing for you, using the SmartSize method in the resize command. Much cleaner than using the pick tool to scale.

The "Open As Layer" script can also be quickly edited to do this exact same thing after it's finished opening the image as a layer. So it wouldn't take much to make the full script.
Thank you so much! I will try this out and let you know how it goes.
Post Reply