Automatic extension of a selection till borders found

Moderator: Kathy_9

Post Reply
ilgk48
Posts: 60
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Automatic extension of a selection till borders found

Post by ilgk48 »

Good afternoon to all,
I'm scanning (300 dpi color) and cleaning the pages of some old magazines.
Some pages contains pics and I wish to protect them before cleaning the text.
Manually acting, I select them one by one (this needs four point and four extensions in freehand mode using the option automatic border); then I reverse the selection.

This morning I was mumbling if there is a way for selecting with a script (or if such a script is already existing).
In summary:

0) I click on a pixel inside the pic of my interest and I launch the script;
1) the script gets the coordinates of the pixel clicked;
2) from that pixel the script expand the selection till encountering the border of the pic;
3) ... done

Thank you very much.
Paolo
LeviFiction
Advisor
Posts: 5984
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, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Automatic extension of a selection till borders found

Post by LeviFiction »

Are you able to give us an example of the type of image you need to select?

Have you tried the Smart selection brush or the auto selection tool?

The smart selection brush lets you brush within the area you want selected and it attempts to "intelligently" select your subject. The Auto-Selection tool uses a simple rectangle you drag across your subject and it attempts to select it. If it fails, it just selects a rectangle. In fact with the way you describe making your selection, as having a definite border and only needing 4 clicks, it sounds like you could just use a regular selection rectangle instead of using the freehand selection.

I don't know if scripting can help with this. I don't know of a script that does this off hand, and I can't personally think of a solution that might work. Other scripters might but I cannot guarantee that.

The problem is that scripts inside of PSP were designed as macros. Just repeating steps found inside PSP to speed up editing of an image. Because it's based on the Python programming language we do have a lot of power to make scripts smarter and more useful, but it's also slow inside PSP and there is no direct way to analyze pixels in an image. So, in order for this to work with a script, we would need a process in which PSP could do all of the work with specific commands. And I don't know of a way to search for a progressively search for a border of unknown width and height from a starting pixel. At least, no way that wouldn't be very slow. And I would need an example of what we were looking at.
ilgk48
Posts: 60
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Re: Automatic extension of a selection till borders found

Post by ilgk48 »

Yes, I'have tried the Smart selection brush and the auto selection tool but they do not :lol: :lol: understand :lol: :lol: my goal :lol: :lol: . They are too intelligent.
The best tool remains the rectangular selection.
In the attachment I used four times the rectangular selection but I have problem with my eyes for exactly framing the four pics and after a while my right hand (mouse) begins to be nervous in stretching the selections. In addition consider that this is a very frequent operation in my job.

While not achieve the same result with four simple clicks within the pics and let PSP find the rectangular contours of the pics? My eyes and my right hand will be very grateful.
Simple to say but, from your reply, I've realized that this is impossible.

Thank you again.
Have a nice day.
Paolo
Attachments
What I wish using four clicks
What I wish using four clicks
Post Reply