ImageMagick convert command not working through java
Posted: 2014-06-22T10:04:32-07:00
Hello ,
I am using ImageMagick-6.8.9-Q16 version on windows and trying to run the compare and convert command through java.
Currently I am using the convert command to color some region in an image. Command below.
It works find and gives the desired result. However I want to pass the reference and resultant image in the command as a argument.
It doesn't seem to work. Can anyone help me to make this work.
I am using ImageMagick-6.8.9-Q16 version on windows and trying to run the compare and convert command through java.
Currently I am using the convert command to color some region in an image. Command below.
Code: Select all
String[] command = {"cmd.exe","/c", "cd \"C:\\Program Files\\ImageMagick-6.8.9-Q16\" && convert \"D:\\ImageComparison\\Copy\\All_Apps_Copy1.bmp\" -fill black -draw \"rectangle 287,11 347,35 rectangle 92,14 199,36 rectangle 613,432 628,448\" \"D:\\ImageComparison\\Copy\\All_Apps_Copy11.bmp\"" };
ProcessBuilder pb = new ProcessBuilder(command);
Process process = pb.start();
int row = process.waitFor();
Code: Select all
String command[] = {"C:\\Program Files\\ImageMagick-6.8.9-Q16\\convert.exe","D:\\ImageComparison\\Copy\\All_Apps_Copy1.bmp" ,"-fill black -draw \"rectangle 287,11 347,35\"", \"D:\\ImageComparison\\Copy\\All_Apps_Copy11.bmp\""};