package a;

import cn.hutool.core.img.FontUtil;
import cn.hutool.core.img.Img;
import cn.hutool.core.img.ImgUtil;

import java.awt.*;
import java.io.File;

public class A {
    public static void main(String[] args) {
        long x = System.currentTimeMillis();

        Font font = FontUtil.createSansSerifFont(16);

        Img img = Img.from(new File("D:\\W\\1.jpg"))
            .setPositionBaseCentre(false)
            .pressText("宇宙星系桌面壁纸", Color.WHITE, font, 0, 100, 0.5f)
            .pressText("宇宙星系桌面壁纸", Color.WHITE, font, 0, 200, 0.5f);
        ImgUtil.write(img.getImg(), new File("D:\\W\\2.jpg"));

        System.out.println(System.currentTimeMillis() - x);
    }
}
