接口说明(新版)
更新时间:2025-11-04
图像特效
黑白图像上色
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 // 参数为本地路径
6 String image = "test.jpg";
7 JSONObject res = client.colourize(image, options);
8 System.out.println(res.toString(2));
9
10 // 参数为二进制数组
11 byte[] file = readFile("test.jpg");
12 res = client.colourize(file, options);
13 System.out.println(res.toString(2));
14}
接口详情
可参考API文档:黑白图像上色
图像风格转换
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 """ 如果有可选参数 """
6 options.put("option", "cartoon");
7
8 // 参数为本地路径
9 String image = "test.jpg";
10 JSONObject res = client.styleTrans(image, options);
11 System.out.println(res.toString(2));
12
13 // 参数为二进制数组
14 byte[] file = readFile("test.jpg");
15 res = client.styleTrans(file, options);
16 System.out.println(res.toString(2));
17}
接口详情
可参考API文档:图像风格转换
人像动漫化
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 """ 如果有可选参数 """
6 options.put("type", "anime");
7 options.put("mask_id", 3);
8
9 // 参数为本地路径
10 String image = "test.jpg";
11 JSONObject res = client.selfieAnime(image, options);
12 System.out.println(res.toString(2));
13
14 // 参数为二进制数组
15 byte[] file = readFile("test.jpg");
16 res = client.selfieAnime(file, options);
17 System.out.println(res.toString(2));
18}
接口详情
可参考API文档:人像动漫化
图像增强
图像去雾
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 // 参数为本地路径
6 String image = "test.jpg";
7 JSONObject res = client.dehaze(image, options);
8 System.out.println(res.toString(2));
9
10 // 参数为二进制数组
11 byte[] file = readFile("test.jpg");
12 res = client.dehaze(file, options);
13 System.out.println(res.toString(2));
14}
接口详情
可参考API文档:图像去雾
图像对比度增强
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 // 参数为本地路径
6 String image = "test.jpg";
7 JSONObject res = client.contrastEnhance(image, options);
8 System.out.println(res.toString(2));
9
10 // 参数为二进制数组
11 byte[] file = readFile("test.jpg");
12 res = client.contrastEnhance(file, options);
13 System.out.println(res.toString(2));
14}
接口详情
可参考API文档:图像对比度增强
图像无损放大
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 // 参数为本地路径
6 String image = "test.jpg";
7 JSONObject res = client.imageQualityEnhance(image, options);
8 System.out.println(res.toString(2));
9
10 // 参数为二进制数组
11 byte[] file = readFile("test.jpg");
12 res = client.imageQualityEnhance(file, options);
13 System.out.println(res.toString(2));
14}
接口详情
可参考API文档:图像无损放大
拉伸图像恢复
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5
6 // 参数为本地路径
7 String image = "test.jpg";
8 JSONObject res = client.stretchRestore(image, options);
9 System.out.println(res.toString(2));
10
11 // 参数为二进制数组
12 byte[] file = readFile("test.jpg");
13 res = client.stretchRestore(file, options);
14 System.out.println(res.toString(2));
15}
接口详情
可参考API文档:拉伸图像恢复
图像修复
SDK 调用示例
Java
1 public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4 // [{'width': 92, 'top': 25, 'height': 36, 'left': 543}]
5 JSONObject jsonObject = new JSONObject();
6 jsonObject.put("width",1);
7 jsonObject.put("top",1);
8 jsonObject.put("height",1);
9 jsonObject.put("left",1);
10 List<JSONObject> rectangle = new ArrayList<JSONObject>();
11 rectangle.add(jsonObject);
12 // 参数为本地路径
13 String image = "test.jpg";
14 JSONObject res = client.inpaintingByMask(image, rectangle, options);
15 System.out.println(res.toString(2));
16
17 // 参数为二进制数组
18 byte[] file = readFile("test.jpg");
19 res = client.inpaintingByMask(file, rectangle, options);
20 System.out.println(res.toString(2));
21}
接口详情
可参考API文档:图像修复
图像清晰度增强
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 // 参数为本地路径
6 String image = "test.jpg";
7 JSONObject res = client.imageDefinitionEnhance(image, options);
8 System.out.println(res.toString(2));
9
10 // 参数为二进制数组
11 byte[] file = readFile("test.jpg");
12 res = client.imageDefinitionEnhance(file, options);
13 System.out.println(res.toString(2));
14}
接口详情
可参考API文档:图像清晰度增强
图像色彩增强
SDK 调用示例
Java
1public void sample(AipImageProcess client) {
2 // 传入可选参数调用接口
3 HashMap<String, String> options = new HashMap<String, String>();
4
5 // 参数为本地路径
6 String image = "test.jpg";
7 JSONObject res = client.colorEnhance(image, options);
8 System.out.println(res.toString(2));
9
10 // 参数为二进制数组
11 byte[] file = readFile("test.jpg");
12 res = client.colorEnhance(file, options);
13 System.out.println(res.toString(2));
14
15 // 参数为url
16 String url = "http://image";
17 res = client.colorEnhanceUrl(url, options);
18 System.out.println(res.toString(2));
19}
接口详情
可参考API文档:图像色彩增强
