Create Solid color rectangle with ImageMagick

508 Views Asked by At

I can not find any command to create solid color with rgb options in Java.

I can create it in commandLine like

convert -size 100x200 xc:rgb(0,255,255) whatever.jpg 

from here

But how do that in Java?

Something like this:

        ConvertCmd cmd = new ConvertCmd();
        IMOperation oper = new IMOperation();

        LinkedList<String> list = new LinkedList();
        list.add("xc:(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue() + ")");
        list.add("-size " + width + "x" + height);
        list.add(fillepath);
        oper.addRawArgs(list);

        cmd.run(oper);

looks not so pretty

0

There are 0 best solutions below