Concatenate multiple image files into a single image
Minimum Origin Version Required: Origin 2015 SR0
1. imfcat fname:=fns$ cols:=3 ofname:=%ymyimage.jpg;
2. imfcat fname:=fns$ dir:=vert cols:=2 rows:=4 ofname:= C:\Users\UserName\Documents\OriginLab\2017\User Files\myimage.png;
3. imfcat fname:="C:\Program Files\OriginLab\Origin2017\Samples\Image Processing and Analysis\myocyte1.tif%(crlf)C:\Program Files\OriginLab\Origin2017\Samples\Image Processing and Analysis\myocyte2.tif%(crlf)C:\Program Files\OriginLab\Origin2017\Samples\Image Processing and Analysis\myocyte3.tif" cols:=2 color:=color(240,208,0) ofname:=%yabc.png;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Files to be Concatenated | fname |
Input string |
|
Specify image files to be concatenated. Supported types include Bitmap, Joint Photographic Experts Group, JPEG2000, Portable Network Graphics, Portable Images, Sun Raster, and Tag Image File. |
Concatenate Direction | dir |
Input int |
|
Specify the concatenated direction.
Option list:
|
Columns | cols |
Input int |
|
Specify the number of columns in the concatenated image. The concatenated image will be arranged on a col by row grid. |
Rows | rows |
Input int |
|
Specify the number of rows in the concatenated image. The concatenated image will be arranged on a col by row grid. If the number of row is not specified, it is automatically determined by the number of files and columns. |
Background Color | color |
Input int |
|
Specify the fill color for extra grid that has no image. Color may be an index into Origin's Color List : 0 (Black), 1 (Red), ..., up to 23 (Dark Gray). You can also use the color function to assign any RGB color, see example 3 in Command Line Usage section. |
Output File Name | ofname |
Output string |
|
Specify the name of the concatenated image file. |
This X-Function is used to concatenate multiple image files as a single one.
The following example concatenates all 8 image files with prefix "myocyte" into 1.
string fns, path$=system.path.program$ + "Samples\Image Processing and Analysis\"; findfiles fname:=fns$ ext:="myocyte*.tif"; int n = fns.GetNumTokens(CRLF); imfcat fname:=fns$ cols:=4 ofname:=%ymyimage.jpg;
Keywords:combine