A versatile wrapper for using ImageMagick convert, for folder(s) of images.
Keywords in the command are as follows: @in1@ .. @in2@ refer to single images in corresponding input ports. @ina1@... are used to refer to array input image folders. @out@ referers to the output file. In addition @dirin1@.. @dirina1@.. refer to the input folders, but is not valid if dir1/dir2 inputs are Arrays.
If you use extension to convert image format, remember the dot (.), e.g. extension=".png"
Use the _custom("cpu") annotation to set number of parallel threads.
Guide for using imagemagick: http://www.imagemagick.org/script/command-line-options.php
Version | 1.2 |
---|---|
Bundle | anima |
Categories | Image Processing |
Authors | Ville Rantanen (ville.rantanen@helsinki.fi) |
Issue tracker | View/Report issues |
Requires | bash ; imagemagick (DEB) |
Source files | component.xml convertop.sh |
Usage | Example with default values |
Name | Type | Mandatory | Description |
---|---|---|---|
ina1 | Array<Image> | Optional | Input array of images, referred as @ina1@. |
ina2 | Array<Image> | Optional | Input array of images, referred as @ina2@. |
in1 | ImageList | Optional | Input folder of images, referred as @in1@. |
in2 | ImageList | Optional | Input folder of images, referred as @in2@. |
in | Array<ImageList> | Optional | Array Input folders of images. Array folders are referred as @a1@, @a2@ ... in order. for convenience, @inall@ inserts all the folders in sequence, see testcase 8 |
commandFile | TextFile | Optional | Command file (see example), overrides the command parameter |
f1 | ImageList | Optional | Source image 1 (@f1@). This folder should contain only one image. The same image is used in each iteration of in1. |
f2 | ImageList | Optional | Source image 2 (@f2@). See input f1. |
Name | Type | Description |
---|---|---|
out | ImageList | Output folder of images. The output name follows input dir1 |
Name | Type | Default | Description |
---|---|---|---|
binary | string | "convert" | Binary to use. You can also use other tools, like "montage". You can also provide the full path to the binary. |
command | string | "@in1@ @out@" | Command switches for convert (if input file command is given, it overrides this parameter.)" |
extension | string | "" | Extension to add to the filename ( ".png" ".tif" ".jpg" ... "_test.png" ) |
failOnMissing | boolean | true | Fails the component if the outputfile does not match the dir1 input filenames (+extension). |
files | int | 0 | If there are no input folders, this number is used as the number of files generated. The resulting files will be named file1[extension], file2[extension], ... Use the variable @filenr@ in the script to get the file number. Remember to use extension when using this parameter. |
filter | string | ".*" | Case insensitive filtering of input files with GNU grep (ex. "png") |
oldExtension | string | "" | Old extension that is replaced by the new one. ( ".png" ".tif" ".jpg" ... "_test.png" ) |
Test case | Parameters▼ | IN ina1 |
IN ina2 |
IN in1 |
IN in2 |
IN in |
IN commandFile |
IN f1 |
IN f2 |
OUT out |
---|---|---|---|---|---|---|---|---|---|---|
case1 | properties | (missing) | (missing) | in1 | (missing) | (missing) | (missing) | (missing) | (missing) | out |
command=@in1@ -negate -gaussian-blur 20 -fill red -draw "circle 30,30 10,10" @out@ |
||||||||||
case2 | properties | (missing) | (missing) | in1 | (missing) | (missing) | (missing) | (missing) | (missing) | out |
extension=_test.png, |
||||||||||
case3 | properties | (missing) | (missing) | in1 | (missing) | (missing) | commandFile | (missing) | (missing) | out |
metadata.timeout=50 |
||||||||||
case4_montage | properties | (missing) | (missing) | in1 | in2 | (missing) | (missing) | (missing) | (missing) | out |
command=@in1@ @in2@ -geometry +0+0 @out@, |
||||||||||
case5_error | properties | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | (expecting failure) |
binary=ls |
||||||||||
case6_parallel | properties | (missing) | (missing) | in1 | (missing) | (missing) | (missing) | (missing) | (missing) | out |
command=@in1@ -negate -gaussian-blur 20 -fill red -draw "circle 30,30 10,10" @out@ |
||||||||||
case7_array | properties | ina1 | ina2 | (missing) | (missing) | (missing) | (missing) | (missing) | (missing) | out |
command=@ina1@ @ina2@ -tile 2x @out@, |
||||||||||
case8_dirArray | properties | (missing) | (missing) | (missing) | (missing) | in | (missing) | (missing) | (missing) | out |
command=@inall@ -tile 2x @out@, |
||||||||||
case9_text_annotation | properties | (missing) | (missing) | in1 | (missing) | (missing) | (missing) | (missing) | (missing) | out |
command=@in1@ -pointsize 40 -draw "gravity south fill white text 0,0 'YOLO !'" @out@ |