Image magick java

前端 未结 5 1060
误落风尘
误落风尘 2020-12-08 03:07

How can I modify image from java through ImageMagick? Is there any way of doing it?

5条回答
  •  心在旅途
    2020-12-08 03:40

    For ImageMagic 1.4.0

    // create command
    ConvertCmd cmd = new ConvertCmd();
    
    // create the operation, add images and operators/options
    IMOperation op = new IMOperation();
    op.addImage("source_picture.jpg"); // source file
    op.resize(800,600);
    // of op.resize(800); // and height calculate automatically
    op.addImage("resized_picture.jpg"); // destination file file
    
    // execute the operation
    cmd.run(op);
    

    And if you like maven!

    
        org.im4java
        im4java
        1.4.0
    
    

提交回复
热议问题