diff --git a/README.md b/README.md index 98c5c1f5..9a54588c 100644 --- a/README.md +++ b/README.md @@ -361,16 +361,25 @@ docker run -d -p 7860:7860 \ # Q&A -## 如何修改预设尺寸和颜色? +## 1. 如何修改预设尺寸和颜色? - 尺寸:修改[size_list_CN.csv](demo/assets/size_list_CN.csv)后再次运行 `app.py` 即可,其中第一列为尺寸名,第二列为高度,第三列为宽度。 - 颜色:修改[color_list_CN.csv](demo/assets/color_list_CN.csv)后再次运行 `app.py` 即可,其中第一列为颜色名,第二列为Hex值。 -## 如何修改水印字体? +## 2. 如何修改水印字体? 1. 将字体文件放到`hivision/plugin/font`文件夹下 2. 修改`hivision/plugin/watermark.py`的`font_file`参数值为字体文件名 +## 3. 如何添加社交媒体模板照? + +1. 将模板图片放到`hivision/plugin/template/assets`文件夹下。模板图片是一个4通道的透明png。 +2. 在`hivision/plugin/template/assets/template_config.json`文件中添加最新的模板信息,其中`width`为模板图宽度(px),`height`为模板图高度(px),`anchor_points`为模板中透明区域的四个角的坐标(px);`rotation`为透明区域相对于垂直方向的旋转角度,>0为逆时针,<0为顺时针。 +3. 在`demo/processor.py`的`_generate_image_template`函数中的`TEMPLATE_NAME_LIST`变量添加最新的模板名 + + + +
# 📧 联系我们 diff --git a/README_EN.md b/README_EN.md index 93929068..843710fb 100644 --- a/README_EN.md +++ b/README_EN.md @@ -43,6 +43,7 @@ English / [中文](README.md) / [日本語](README_JP.md) / [한국어](README_K - [API Service Deployment](#️-deploy-api-service) - [Docker Deployment](#-docker-deployment) - [Contact Us](#-contact-us) +- [Q&A](#qa) - [Contributors](#contributors) - [Thanks for support](#thanks-for-support) - [License](#lincese) @@ -353,18 +354,26 @@ docker run -d -p 7860:7860 \
-# 💻 Development Tips +# Q&A -## How to modify preset sizes and colors? +## 1. How to modify preset sizes and colors? - Size: After modifying [size_list_EN.csv](demo/assets/size_list_EN.csv), run `app.py` again. The first column is the size name, the second column is the height, and the third column is the width. - Color: After modifying [color_list_EN.csv](demo/assets/color_list_EN.csv), run `app.py` again. The first column is the color name, and the second column is the Hex value. -## How to Change the Watermark Font? +## 2. How to Change the Watermark Font? 1. Place the font file in the `hivision/plugin/font` folder. 2. Change the `font_file` parameter value in `hivision/plugin/watermark.py` to the name of the font file. +## 3. How to Add Social Media Template Photos? + +1. Place the template image in the `hivision/plugin/template/assets` folder. The template image should be a 4-channel transparent PNG. +2. Add the latest template information to the `hivision/plugin/template/assets/template_config.json` file. Here, `width` is the template image width (px), `height` is the template image height (px), `anchor_points` are the coordinates (px) of the four corners of the transparent area in the template; `rotation` is the rotation angle of the transparent area relative to the vertical direction, where >0 is counterclockwise and <0 is clockwise. +3. Add the name of the latest template to the `TEMPLATE_NAME_LIST` variable in the `_generate_image_template` function of `demo/processor.py`. + + +
# 📧 Contact Us diff --git a/assets/social_template.png b/assets/social_template.png new file mode 100644 index 00000000..edf10221 Binary files /dev/null and b/assets/social_template.png differ