@Jameelrrf
Interesting ask:) I have explored this option as part of your request so thanks 🙂
Please follow the below approach:

PAD flow code:
SET inputImage1 TO $'''C:\\Boot\\1.png'''
SET inputImage2 TO $'''C:\\Boot\\2.png'''
SET outputImage TO $'''C:\\Boot\\MergedImage.jpg'''
@@copilotGeneratedAction: 'True'
Scripting.RunPowershellScript.RunPowershellScript Script: $'''# Function to check if an assembly is loaded
function Is-AssemblyLoaded {
param (
[string]$assemblyName
)
$loadedAssemblies = [AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object { $_.GetName().Name }
return $loadedAssemblies -contains $assemblyName
}
# Check if System.Drawing is loaded, if not, load it
if (-not (Is-AssemblyLoaded -assemblyName \"System.Drawing\")) {
try {
Add-Type -AssemblyName System.Drawing
Write-Output \"System.Drawing assembly loaded successfully.\"
} catch {
Write-Error \"Failed to load System.Drawing assembly: $_\"
exit
}
} else {
Write-Output \"System.Drawing assembly is already loaded.\"
}
# Define paths to the images
$image1Path = \"%inputImage1%\"
$image2Path = \"%inputImage2%\"
$outputPath = \"%outputImage%\"
try {
# Load the images
Write-Output \"Loading Image 1 from $image1Path\"
$image1 = [System.Drawing.Image]::FromFile($image1Path)
Write-Output \"Loading Image 2 from $image2Path\"
$image2 = [System.Drawing.Image]::FromFile($image2Path)
# Determine the dimensions of the merged image
$width = [Math]::Max($image1.Width, $image2.Width)
$height = $image1.Height + $image2.Height
# Create a new bitmap to hold the merged image
Write-Output \"Creating a new bitmap with dimensions $width x $height\"
$mergedImage = New-Object System.Drawing.Bitmap($width, $height)
# Create a graphics object to draw the images onto the bitmap
$graphics = [System.Drawing.Graphics]::FromImage($mergedImage)
# Draw the first image
Write-Output \"Drawing Image 1\"
$graphics.DrawImage($image1, 0, 0, $image1.Width, $image1.Height)
# Draw the second image below the first image
Write-Output \"Drawing Image 2\"
$graphics.DrawImage($image2, 0, $image1.Height, $image2.Width, $image2.Height)
# Save the merged image
Write-Output \"Saving the merged image to $outputPath\"
$mergedImage.Save($outputPath, [System.Drawing.Imaging.ImageFormat]::Jpeg)
# Clean up
$image1.Dispose()
$image2.Dispose()
$mergedImage.Dispose()
$graphics.Dispose()
Write-Output \"Merged image saved to $outputPath\"
} catch {
Write-Error \"An error occurred: $_\"
}''' ScriptOutput=> PowershellOutput
How to copy/paste the above code into PAD?

Thanks,
Deenuji Loganathan 👩💻
Automation Evangelist 🤖
Follow me on LinkedIn 👥
-------------------------------------------------------------------------------------------------------------
If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀