Centring a selection?

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Centring a selection?

Post by terrypin »

I'm using PSP 8 and suspect this will prove embarrassingly obvious...

What is the quickest way to centre a selection horizontally please? IOW, the equivalent of using Objects > Align > Horz. Center in Canvas (Alt+o+a+z).

I often need to do this to shift titles if I've prematurely merged text layers into the background.

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
photodrawken
Posts: 684
Joined: Wed Sep 26, 2012 8:40 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
ram: 16Gb
Hard_Drive_Capacity: 324Gb
Location: USA

Re: Centring a selection?

Post by photodrawken »

You can't. A selection is only an indicator of the area that will be affected by subsequent actions. Moving actual pixels requires an object.
terrypin wrote:I often need to do this to shift titles if I've prematurely merged text layers into the background.
You first need to create a new object from the selection, then center that new object, but I don't think that will accomplish what you want to do if the background is anything but a solid colour.
Ken
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Centring a selection?

Post by terrypin »

Thanks Ken, but how do I 'create a new object from the selection'?

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
photodrawken
Posts: 684
Joined: Wed Sep 26, 2012 8:40 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
ram: 16Gb
Hard_Drive_Capacity: 324Gb
Location: USA

Re: Centring a selection?

Post by photodrawken »

Terry,

Here in PSPX5, after making the selection use the main menu bar: Selection...Promote Selection to Layer.

Added:
After promoting the selection, you can then use the main menu bar's Object...Align...Horiz. Center in Canvas.
Ken
Yes, I think it can be eeeeeasily done...
Just take everything out on Highway 61.
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Centring a selection?

Post by terrypin »

Thanks, but that was one of the first things I tried. As you see the alignment menu is greyed out for a promoted selection:

https://dl.dropboxusercontent.com/u/401 ... tion-1.jpg

Have I misunderstood your instructions?

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
User avatar
hartpaul
Advisor
Posts: 2893
Joined: Tue Mar 20, 2012 3:38 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: ASUSTeK P7P55D STRIX B240F GAMING
processor: IntelCore i7 7700 3.60 Ghz
ram: 8 Gb
Video Card: Nvidia GeForce GTX 1050
sound_card: Nvidia High Definition Audio
Hard_Drive_Capacity: 1000 Gb
Monitor/Display Make & Model: AOC
Corel programs: PSP8,X2 to X9,2018,2019,2020
Location: Australia

Re: Centring a selection?

Post by hartpaul »

Hi Terry,
Just tested this in PSP8.
From your example I am guessing that you have a map, and you have placed a title in a white area (canvas??) at the top. Then you merged the text layer and saved it. Later you realised that the text was off centre and now want to fix that.
(If you still had the original image and text just merged then you could have used the back arrow (Undo) to get back to the text in its boundary box (later versions similar to the pick tool box) and then Objects > Allign > Horizontal Centre in canvas.)

To fix that text you are better off using a paint brush with color set as the background that the text is on (white?) and then painting over the text and finally typing the text again and then after Applying do Objects > Allign etc.
If the text is over the map features then any operations you do will not replace the information that has been wiped out by the text being placed on top of it.
Systems available Win7, Win 8.1,Win 10 Version 1607 Build 14393.2007 & version 20H2 Build 19042.867
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: Centring a selection?

Post by LeviFiction »

Personally I never merge my text down, and I always keep a PSP version of my image just in case.

However, as is noted in PSP8 Object Align options are only for vector objects. Don't remember when this changed but I was happy when it did.

If you want align options that work on raster layers as well that's possible through scripts.
https://levifiction.wordpress.com/
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Centring a selection?

Post by terrypin »

Thanks Paul, hadn't thought of that relatively simple solution!

I've been doing it by simply moving the selection visually, but obviously that doesn't give precise centering..

@LeviFiction: So in more recent PSP versions does the Align menu work on raster selections too?

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
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: Centring a selection?

Post by LeviFiction »

If you promote the selection to a layer or float the selection then yes you can use object align functions in the most recent versions of PSP.

If you would like scripts to give you the align functions for rasters let me know. I used to have some before the rules changed, could try and find them.
https://levifiction.wordpress.com/
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Centring a selection?

Post by terrypin »

LeviFiction wrote:If you promote the selection to a layer or float the selection then yes you can use object align functions in the most recent versions of PSP.

If you would like scripts to give you the align functions for rasters let me know. I used to have some before the rules changed, could try and find them.
If you can do that without much trouble that would be much appreciated, thanks!

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
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: Centring a selection?

Post by LeviFiction »

Alright, so these are very simple.

They use the Mover tool to move the current layer and Align it to either the Top, Left, Right, Bottom, Vertical Center, Horizontal center, or Center of the canvas.

If you want to use them on a selection, either promote the selection to a layer, or float the selection first.
Attachments
AlignmentScripts.zip
(3.83 KiB) Downloaded 225 times
https://levifiction.wordpress.com/
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Centring a selection?

Post by terrypin »

Excellent, thanks a lot, greatly appreciated!

I had to change the 'front end stuff' to:

Code: Select all

from JascApp import *

def ScriptProperties():
    return {
        'Author': 'LeviFiction',
        'Copyright': '',
        'Description': '',
        'Host': 'Paint Shop Pro',
        'Host Version': '8.10'
        }
All scripts then worked a treat.

But could you give me a quick heads up on how I'd amend them slightly so that the original selection gets removed please? Othwerwise it appears I have to follow the running of the script with manual operations to do that.

https://dl.dropboxusercontent.com/u/401 ... ipts-1.jpg

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
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: Centring a selection?

Post by LeviFiction »

I don't know if there's an easy way to do that or not.

I mean, it should remain manual. Unless you can guarantee the only alignment you will ever want to do is on a selection.

If you want to use the align scripts on a non-selection and the script attempts to remove a selected area then it gets messy.

One way to handle it is:

1) Check for selection

2) If selected, promote selection to layer

3) Align new layer

4) Select original layer

5) Fill currently selected area with current foreground or background color using the Fill tool centered in the selection rectangle.

6) Turn off selection

I am assuming you're just doing a full fill with a solid color. In your example White.

The exact code, I don't have I would have to look up or record the steps and edit them.
https://levifiction.wordpress.com/
terrypin
Posts: 492
Joined: Tue Jun 29, 2010 9:51 am
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Asus Z170 Pro 4
processor: Intel Core i7 6700K 4.0GHz
ram: 32 GB
Video Card: None - uses built-in graphics
sound_card: HD onboard sound card
Hard_Drive_Capacity: 4.256 TB
Monitor/Display Make & Model: iLyama Prolite E2403WS 24" 1920x1200
Corel programs: Paint Shop Pro 8; Paint Shop Pro 2018
Location: East Grinstead UK

Re: Centring a selection?

Post by terrypin »

OK, thanks. No problem, as it's a trivial manual task anyway. It would just be neat if it 'moved' the promoted selection to its aligned position (as the Align command does for an object), rather than effectively copying it.

I wonder if the following alternative approach to the script would be possible? It assumes a manual but 'tight fit' rectangular selection, on a solid background.

1. Determine the position and dimensions of the selection relative to the active window.
2. Determine the width and height of the active window.
3. Activate the move tool and click/drag the selection to its calculated position.

Of course, this wouldn't give the precise alignment of your script, unless the selection was made exactly around the edges of the text.

--
Terry, East Grinstead, UK
--
Terry, East Grinstead, UK
Using PSP 8 & PSP 2018 under Win 10
Post Reply