Hi,
before they close forum.
Lately, I often need to combine two pages of a magazine into one, double-width page. How to do it via script?
I have both images open, with the active image/document being the left side. The other one is supposed to be on the right.
What should the script do?
1. in the active image, enlarge the canvas to twice the width with the content to be left aligned
2. copy the (whole) inactive 2nd image
3. paste it into the active document (as a new layer) and right align it
4. merge the layers
Have someone such simple script to share? Thanks.
Script? to combine 2 opened images to one large with align
Moderator: Kathy_9
-
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: Script? to combine 2 opened images to one large with align
Whipped this one up really quick.
The one problem with what you've asked for is that it has to make some assumptions. For example, this script assumes that the last image opened is the second page of the document. It requires that you always open your images with first page 1 and then page 2. Then you need to run it from page 1. Also, you cannot open any other image before running the script. So you cannot open 6 images in pairs of Page 1, Page 2, Page 1a, Page 2a, Page 1b, Page 2b, etc. It'll always grab only the last opened image.
Given more time I could make it smarter, but wanted to be quick about it. It also doesn't take differences of size into consideration. So if the pages are not exactly the same size it might under or over-extend the canvas of the first page.
The one problem with what you've asked for is that it has to make some assumptions. For example, this script assumes that the last image opened is the second page of the document. It requires that you always open your images with first page 1 and then page 2. Then you need to run it from page 1. Also, you cannot open any other image before running the script. So you cannot open 6 images in pairs of Page 1, Page 2, Page 1a, Page 2a, Page 1b, Page 2b, etc. It'll always grab only the last opened image.
Given more time I could make it smarter, but wanted to be quick about it. It also doesn't take differences of size into consideration. So if the pages are not exactly the same size it might under or over-extend the canvas of the first page.
- Attachments
-
- ExpandAndAlign.zip
- (757 Bytes) Downloaded 24 times
https://levifiction.wordpress.com/
-
Radim
- Posts: 712
- Joined: Mon Nov 01, 2010 5:54 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 4GB
- Monitor/Display Make & Model: 27 inch
Re: Script? to combine 2 opened images to one large with align
Thanks,
I tested it on two PNG's and it works fine, at the end still remains 2 separate layers. Perhaps first image needs convert to layers or so.. to merge them
Screen - https://imgur.com/a/3LSmWCN
I tested it on two PNG's and it works fine, at the end still remains 2 separate layers. Perhaps first image needs convert to layers or so.. to merge them
Screen - https://imgur.com/a/3LSmWCN
-
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: Script? to combine 2 opened images to one large with align
No, I did that on purpose. In case any further adjustments need to be made. Doing a final merge will put them all onto a single flat layer.
Here's a version with merge as the final option.
Here's a version with merge as the final option.
- Attachments
-
- ExpandAndAlign-merge.zip
- (802 Bytes) Downloaded 14 times
https://levifiction.wordpress.com/
-
Radim
- Posts: 712
- Joined: Mon Nov 01, 2010 5:54 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- ram: 4GB
- Monitor/Display Make & Model: 27 inch
Re: Script? to combine 2 opened images to one large with align
I tought so. Thanks.LeviFiction wrote: ↑Wed Feb 07, 2024 10:18 pm No, I did that on purpose. In case any further adjustments need to be made. Doing a final merge will put them all onto a single flat layer.
Here's a version with merge as the final option.
