{
  "openapi": "3.0.3",
  "info": {
    "title": "图片水印裁剪缩略接口",
    "description": "提供缩略图生成、裁剪、水印添加等多种图像处理功能，接口设计简便，可满足多样化的图像编辑需求。",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/1-8": {
      "x-pointCode": 8,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "图像裁剪",
        "description": "提供了一种便捷的方式来选取原图的特定区域，并生成该区域的裁剪版本。这适用于各种场景，如社交媒体头像、博客封面图片、文档截图等，让您能够更灵活地利用图片资源。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "裁剪后的图片地址"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_8_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "string",
                    "description": "裁剪后的宽度"
                  },
                  "height": {
                    "type": "string",
                    "description": "裁剪后的高度"
                  },
                  "keepRate": {
                    "type": "string",
                    "description": "当type=size时有效。是否保持高宽比,1为保持，0为不保持"
                  },
                  "rate": {
                    "type": "string",
                    "description": "当type=rate时，此值才有效，指的是缩小比率。其值为0到1之间的一个小数。"
                  },
                  "src_img_url": {
                    "type": "string",
                    "description": "图片URL"
                  },
                  "type": {
                    "type": "string",
                    "description": "type=size为尺寸缩略，br type=rate为比率缩略。"
                  }
                },
                "required": [
                  "src_img_url",
                  "type"
                ]
              }
            }
          }
        }
      }
    },
    "/1-5": {
      "x-pointCode": 5,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "生成缩略图-base64",
        "description": "生成缩略图服务可根据您传入的比率，将原始图片缩减到指定大小，帮助快速创建缩略图版本。适用于网页设计、图像分享和数据库管理。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "生成的图片地址"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_5_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "type=size为尺寸缩略，br type=rate为比率缩略。"
                  },
                  "src_img_base64": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 10500000,
                    "description": "图片文件的base64格式字符串。"
                  },
                  "height": {
                    "type": "string",
                    "description": "缩略图高度，单位px，正整数"
                  },
                  "width": {
                    "type": "string",
                    "description": "缩略图宽度，单位px,，正整数"
                  },
                  "keepRate": {
                    "type": "string",
                    "description": "当type=size时有效。br/是否保持高宽比,1为保持，0为不保持"
                  },
                  "rate": {
                    "type": "string",
                    "description": "当type=rate时，此值才有效，指的是缩小比率。其值为0到1之间的一个小数。"
                  }
                },
                "required": [
                  "type",
                  "src_img_base64"
                ]
              }
            }
          }
        }
      }
    },
    "/1-4": {
      "x-pointCode": 4,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "图像裁剪-base64",
        "description": "提供一种便捷的裁剪图像特定区域的方式，可帮助您从原始图片中提取感兴趣的部分，以便更好地展示或应用于不同场合。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "裁剪后的图片地址"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_4_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "string",
                    "description": "裁剪后的宽度"
                  },
                  "height": {
                    "type": "string",
                    "description": "裁剪后的高度"
                  },
                  "x": {
                    "type": "string",
                    "description": "从x轴哪个座标点开始"
                  },
                  "y": {
                    "type": "string",
                    "description": "从y轴哪个座标点开始"
                  },
                  "src_img_base64": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 10000000,
                    "description": "原图的base64格式字符串。"
                  }
                },
                "required": [
                  "width",
                  "height",
                  "src_img_base64"
                ]
              }
            }
          }
        }
      }
    },
    "/1-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 10,
      "x-connect-timeout": 10,
      "post": {
        "summary": "添加图片水印-base64",
        "description": "该接口接收底板图和水印图，依据位置参数，将水印图叠加到底板图上。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "合成后的图片地址"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_3_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "src_img_base64": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000000,
                    "description": "底板图的base64格式字符串。"
                  },
                  "logo_img_base64": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000000,
                    "description": "水印图的base64格式字符串。"
                  },
                  "position": {
                    "type": "string",
                    "description": "水印在底图的位置。可以为这些参数：NorthWest North NorthEast West Center East SouthWest South SouthEast/默认值在右下角。"
                  },
                  "xy": {
                    "type": "string",
                    "description": "比如+5+10表示水印的下边缘距原始图片10像素、右边缘距原始图片5像素"
                  }
                },
                "required": [
                  "src_img_base64",
                  "logo_img_base64"
                ]
              }
            }
          }
        }
      }
    },
    "/1-2": {
      "x-pointCode": 2,
      "x-mode": "mapping",
      "x-read-timeout": 15,
      "x-connect-timeout": 10,
      "post": {
        "summary": "添加图片水印",
        "description": "支持传入底板图和水印图，依据位置参数，接口将水印图添加到底板图上。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "合成后的图片地址"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_2_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "src_img": {
                    "type": "string",
                    "format": "binary",
                    "description": "底图文件"
                  },
                  "logo_img": {
                    "type": "string",
                    "format": "binary",
                    "description": "logo图文件"
                  },
                  "position": {
                    "type": "string",
                    "description": "水印在底图的位置。可以为这些参数：NorthWest North NorthEast West Center East SouthWest South SouthEast/默认值在右下角。"
                  },
                  "xy": {
                    "type": "string",
                    "description": "比如+5+10表示水印的下边缘距原始图片10像素、右边缘距原始图片5像素"
                  }
                },
                "required": [
                  "src_img",
                  "logo_img"
                ]
              }
            }
          }
        }
      }
    },
    "/1-1": {
      "x-pointCode": 1,
      "x-mode": "mapping",
      "x-read-timeout": 10,
      "x-connect-timeout": 5,
      "post": {
        "summary": "生成缩略图",
        "description": "生成缩略图服务可提供一种高效便捷的方式，将原始图片按比例转化为缩略图，适用于预览、节省存储空间等场景，例如社交媒体分享、网页设计、图片库管理。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "des_pic_url": {
                              "type": "string",
                              "description": "生成的图片地址"
                            },
                            "ret_code": {
                              "type": "number",
                              "description": "0为成功，其他失败"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "1_1_POST",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "type=size为尺寸缩略，br type=rate为比率缩略。"
                  },
                  "src_img": {
                    "type": "string",
                    "format": "binary",
                    "description": "以文件形式（ multipart/form-data）上传的表单字段"
                  },
                  "height": {
                    "type": "string",
                    "description": "缩略图高度，单位px，正整数"
                  },
                  "width": {
                    "type": "string",
                    "description": "缩略图宽度，单位px,，正整数"
                  },
                  "keepRate": {
                    "type": "string",
                    "description": "当type=size时有效。br/是否保持高宽比,1为保持，0为不保持"
                  },
                  "rate": {
                    "type": "string",
                    "description": "当type=rate时，此值才有效，指的是缩小比率。其值为0到1之间的一个小数。"
                  }
                },
                "required": [
                  "type",
                  "src_img"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apis/1?tab=book"
  },
  "x-apiCode": "1",
  "x-is-own": false,
  "x-is-op": false
}