crop image-lines (1px) from one image and montage/append them to new images
Posted: 2019-02-21T09:14:55-07:00
I am using ImageMagick 7.0.3-5 Q16 x64 with Batch-File/Commad-Line
I would be very grateful for any help on this "appending issue". The thing is that my current solutiuon has a very poor performance - it should be possible to process this much faster.
I have a list of source TIF-images (more than 2000), width x height=4000 x 2000 px.
I would like to take the first source TIF slice it into its single lines (4000 x 1 px) and append the result to 2000 target TIF.
image0001 slice into its 2000 single lines and append all lines to target TIF 1-2000 (line 1 to 0001.tif, line 2 to 0002.tif, ... line 2000 to 2000.tif)
image0002 slice into its 2000 single lines and append all lines to target TIF 1-2000 (line 1 to the same target file as previously 0001.tif, line 2 to 0002.tif, ... line 2000 to 2000.tif)
image0002 slice into its 2000 single lines and append all lines to target TIF 1-2000 (line 1 to the same target file as previously 0001.tif, line 2 to 0002.tif, ... line 2000 to 2000.tif)
What I would like to have is something like
load image0001 into memory and then append all the lines of this image into the 2000 target TIFs
load image0002 into memory and then append all the lines of this image into the same 2000 target TIFs
What I did so far is
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0000.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0001.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0002.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0003.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0004.tif
...
magick montage image0001.tif -crop 4000x1+0+2000 -tile x4000 -geometry +0+0 all-slits/2000.tif
...
magick montage image2000.tif -crop 4000x1+0+2000 -tile x4000 -geometry +0+0 all-slits/2000.tif
The problem is that this way each source image is loaded into memory 2000 times, although "read once and append all lines of the current file to the target files" would be much faster.
I tried this and that, without succes. Anybody an idea. Thank you very much
I would be very grateful for any help on this "appending issue". The thing is that my current solutiuon has a very poor performance - it should be possible to process this much faster.
I have a list of source TIF-images (more than 2000), width x height=4000 x 2000 px.
I would like to take the first source TIF slice it into its single lines (4000 x 1 px) and append the result to 2000 target TIF.
image0001 slice into its 2000 single lines and append all lines to target TIF 1-2000 (line 1 to 0001.tif, line 2 to 0002.tif, ... line 2000 to 2000.tif)
image0002 slice into its 2000 single lines and append all lines to target TIF 1-2000 (line 1 to the same target file as previously 0001.tif, line 2 to 0002.tif, ... line 2000 to 2000.tif)
image0002 slice into its 2000 single lines and append all lines to target TIF 1-2000 (line 1 to the same target file as previously 0001.tif, line 2 to 0002.tif, ... line 2000 to 2000.tif)
What I would like to have is something like
load image0001 into memory and then append all the lines of this image into the 2000 target TIFs
load image0002 into memory and then append all the lines of this image into the same 2000 target TIFs
What I did so far is
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0000.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0001.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0002.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0003.tif
magick montage image0001.tif -crop 4000x1+0+0 -tile x4000 -geometry +0+0 all-slits/0004.tif
...
magick montage image0001.tif -crop 4000x1+0+2000 -tile x4000 -geometry +0+0 all-slits/2000.tif
...
magick montage image2000.tif -crop 4000x1+0+2000 -tile x4000 -geometry +0+0 all-slits/2000.tif
The problem is that this way each source image is loaded into memory 2000 times, although "read once and append all lines of the current file to the target files" would be much faster.
I tried this and that, without succes. Anybody an idea. Thank you very much