Image Combiner¶
The Image Combiner tool allows users to mechanically append a secondary image file onto the boundaries of their current Image Editor canvas.
Core Mechanics¶
When the "🔗 Combine..." tool is invoked and a secondary file (Image 2) is picked from disk, ShotX performs a complex spatial calculation to build a merged canvas.
- Canvas Rasterization: The current Image Editor scene (known as
Image 1), including all drawn vector primitives, is rasterized into a flat, transparentQImagebuffer. - File Input Loading:
Image 2is buffered into aQImageoff the hard drive. - Dimension Calculation & Spatial Grid:
- Based on the
Orientation(Horizontal Side-by-Side vs Vertical Stacked), the tool calculates the ultimate geometric limits required to fit both images. - Instead of simply snapping to
(0,0), the script analyzes aspect ratio mismatches. IfHorizontalorientation is chosen but the heights differ, theOrthogonal Alignmentdictates mapping:Start: Pinned to Y=0 (Top)Center: Mismatched image vertically centered via(Total Height - Local Height) // 2End: Pinned to maximum Y (Bottom).
- The
Gap Spacinginjects a mathematical block of empty space directly between the two inner coordinates.
- Based on the
- Background Fill & Assembly:
- A master
QImagecanvas matching the calculatedTotal WidthandTotal Heightis created. - It is completely flooded with the user's
Background Fillcolor selection, replacing all transparent dead space caused by spacing gaps and alignment offsets. Image 1andImage 2are cleanly painted atop the background at their calculated X/Y destination coordinates.
- A master
- Undo Registration: The process flattens the result down to the main
pixmaplayer, appending the original components into theCombineCommandpayload. HittingCtrl+Zdetaches the combined structure, seamlessly reverting to the original size and restoring the independent manipulatable state ofImage 1's vectors.
Features¶
- Orientation (Axis): Append on X axis (
Horizontal Side-by-side) or Y axis (Vertical Stacked). - Orthogonal Alignment: Handle size discrepancies by shifting the shorter image to the
Center,Start(Top/Left), orEnd(Bottom/Right) boundary. - Gap Spacing: Inject padding pixels exclusively between the two appended images.
- Background Fill: The uniform
QColorsolid fill used to paint underneath the images, effectively styling the Gap Spacing and Orthogonal dead zones.