I have installed ImageMagickV6 on my linux machine since forever, and recently setup this command to process a distorted image:
convert ref_25X.tif -virtual-pixel Gray +distort Plane2Cylinder 60 MIFF:- | \
convert - -rotate 90 MIFF:- | \
convert - -virtual-pixel Gray +distort Plane2Cylinder 50 MIFF:- | \
convert - -rotate -92 MIFF:- | \
convert - -distort Perspective '10,10 10,10 10,1000 10,1000 1280,10 1280,30 1280,1000 1280,980' MIFF:- | \
convert - -shave 80x100 plane1.png
Since the final application will run on a windows machine I copied it there, to discover that on that machine the installed version is IMv7. And with v7 they radically changed the way they deal with the command line, as described in https://imagemagick.org/script/command-line-processing.php.
So I tried to re-learn how to deal with distortion correction in V7, and discovered that the index page https://imagemagick.org/index.php links to the V6 help https://imagemagick.org/Usage/distorts/ so it is unusable!!!
Can somebody show me how to deal with this in IMv7 ?
I will start with this as a first stab and improve it if you provide a sample of what the input and output images are supposed to look like, and if you tell me what errors you get on your Windows box with it:
magick ref_25X.tif -virtual-pixel Gray ^
+distort Plane2Cylinder 60. ^
-rotate 90 ^
+distort Plane2Cylinder 50 ^
-rotate -92 ^
-distort Perspective "10,10 10,10 10,1000 10,1000 1280,10 1280,30 1280,1000 1280,980" ^
-shave 80x100 plane1.png
I don't use Windows, but I believe it uses the caret (^
) as the line continuation character, and I believe it gets very unhappy about parameters in single quotes. If anyone knows different, please ping me.