 ImageTools - Maple Programming Help

Home : Support : Online Help : Graphics : Image Processing : ImageTools Package : ImageTools/Stack

ImageTools

 Stack
 stack images horizontally or vertically

 Calling Sequence Stack( img_list, dir, opts )

Parameters

 img_list - list(Image); images to stack dir - horizontal or vertical; direction of stacking opts - (optional) equation(s) of the form option = value; specify options for the Stack command

Options

 • halign = left, center, or right
 Specifies the horizontal alignment of vertically stacked images. The default is left.
 • valign = top, center, or bottom
 Specifies the vertical alignment of horizontally stacked images. The default is top.

Description

 • The Stack command stacks images to form a larger image.
 • The img_list parameter is a list of the images that are to be stacked. The images must have the same number of layers.
 • The optional dir parameter determines the stacking direction. Allowable values are horizontal and vertical. If horizontal, then the images are stacked horizontally, the first image in the list being the leftmost. If vertical, then the images are stacked vertically, the first image in the list being the topmost. The default is horizontal.
 • If the input images have different sizes, they are aligned according to the halign or valign options.

Examples

 > $\mathrm{with}\left(\mathrm{ImageTools}\right):$
 > $\mathrm{img1}≔\mathrm{Create}\left(100,150,\left(r,c\right)↦\mathrm{evalf}\left(\left(0.5+0.5\cdot \mathrm{sin}\left(\left(0.005+0.003\cdot c\right)\cdot c\right)\right)\cdot \left(0.5+0.5\cdot \mathrm{sin}\left(0.15\cdot r\right)\right)\right)\right):$
 > $\mathrm{img2}≔\mathrm{Create}\left(120,120,\left(r,c\right)↦\mathrm{evalf}\left(0.5+0.5\cdot \mathrm{sin}\left(0.01\cdot \left({c}^{2}+{r}^{2}\right)\right)\right)\right):$
 > $\mathrm{imga}≔\mathrm{Stack}\left(\left[\mathrm{img1},\mathrm{img2}\right],\mathrm{horizontal}\right):$
 > \mathrm{imgb}≔\mathrm{Stack}\left(\left[\mathrm{img1},\mathrm{img2}\right],\mathrm{horizontal},\mathrm{valign}=\mathrm{center}\right):
 > \mathrm{imgc}≔\mathrm{Stack}\left(\left[\mathrm{img1},\mathrm{img2}\right],\mathrm{horizontal},\mathrm{valign}=\mathrm{bottom}\right):
 > $\mathrm{Embed}\left(\left[\mathrm{imga},\mathrm{imgb},\mathrm{imgc}\right]\right)$   > $\mathrm{imga}≔\mathrm{Stack}\left(\left[\mathrm{img1},\mathrm{img2}\right],\mathrm{vertical}\right):$
 > \mathrm{imgb}≔\mathrm{Stack}\left(\left[\mathrm{img1},\mathrm{img2}\right],\mathrm{vertical},\mathrm{halign}=\mathrm{center}\right):
 > \mathrm{imgc}≔\mathrm{Stack}\left(\left[\mathrm{img1},\mathrm{img2}\right],\mathrm{vertical},\mathrm{halign}=\mathrm{right}\right):
 > $\mathrm{Embed}\left(\left[\mathrm{imga},\mathrm{imgb},\mathrm{imgc}\right]\right)$   > $\mathrm{img_half}≔\mathrm{Stack}\left(\left[\mathrm{Flip}\left(\mathrm{img2},\mathrm{horizontal}\right),\mathrm{img2}\right],\mathrm{horizontal}\right):$
 > $\mathrm{img_final}≔\mathrm{Stack}\left(\left[\mathrm{Flip}\left(\mathrm{img_half},\mathrm{vertical}\right),\mathrm{img_half}\right],\mathrm{vertical}\right):$
 > $\mathrm{Embed}\left(\mathrm{img_final}\right)$ >