编辑图片#
¥Edit Image
使用“编辑图片”节点操作和编辑图片。
¥Use the Edit Image node to manipulate and edit images.
Dependencies
- 如果你未在 Docker 上运行 n8n,则需要安装 GraphicsMagick。
¥If you aren't running n8n on Docker, you need to install GraphicsMagick. 2. 你需要使用 从磁盘读取/写入文件 节点或 HTTP 请求 节点等节点,将图片文件作为数据属性传递给“编辑图片”节点。
¥You need to use a node such as the Read/Write Files from Disk node or the HTTP Request node to pass the image file as a data property to the Edit Image node.
操作#
¥Operations
- 为图片添加模糊效果以降低清晰度
¥Add a Blur to the image to reduce sharpness
- 为图片添加边框
¥Add a Border to the image
- 将一个镜像叠加到另一个镜像之上
¥Composite an image on top of another image
- 创建新图片
¥Create a new image
- 裁剪图片
¥Crop the image
- 在图片上绘制
¥Draw on an image
- 获取有关以下信息图片
¥Get Information about the image
- 多步骤操作:对镜像执行多个操作
¥Multi Step perform multiple operations on the image
- 调整大小:更改图片大小。
¥Resize: Change the size of the image
- 旋转图片
¥Rotate the image
- 沿 X 轴或 Y 轴倾斜图片
¥Shear image along the X or Y axis
- 向图片添加文本
¥Add Text to the image
- 将图片中的颜色设置为透明。
¥Make a color in image Transparent
节点参数#
¥Node parameters
此节点的参数取决于你选择的操作。
¥The parameters for this node depend on the operation you select.
模糊参数#
¥Blur parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- Blur:输入一个数字,用于设置模糊强度,范围为 0 到 1000。数值越大,图片越模糊。
¥Blur: Enter a number to set how strong the blur should be, between 0 and 1000. Higher numbers create blurrier images.
- Sigma:输入一个数字,用于设置模糊的阴影值,范围为 0 到 1000。数值越大,图片越模糊。
¥Sigma: Enter a number to set the stigma for the blur, between 0 and 1000. Higher numbers create blurrier images.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
边界参数#
¥Border parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 边框宽度:输入边框宽度。
¥Border Width: Enter the width of the border.
- 边框高度:输入边框的高度。
¥Border Height: Enter the height of the border.
- 边框颜色:设置边框颜色。你可以输入十六进制代码或选择色板来打开颜色选择器。
¥Border Color: Set the color for the border. You can either enter a hex or select the color swatch to open a color picker.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
复合参数#
¥Composite parameters
- 属性名称:输入存储图片数据的二进制属性名称。此镜像为你的基础镜像。
¥Property Name: Enter the name of the binary property that stores the image data. This image is your base image.
- 复合图片属性:请输入存储要合成到“属性名称”图片之上的图片的二进制属性的名称。
¥Composite Image Property: Enter the name of the binary property that stores image to composite on top of the Property Name image.
- 操作符:选择复合运算符,以确定复合操作的方式。选项包括:
¥Operator: Select composite operator, which determines how the composite works. Options include:
-
添加
¥Add
-
Atop
-
凹凸贴图
¥Bumpmap
-
复制
¥Copy
-
复制黑色
¥Copy Black
-
复制蓝色
¥Copy Blue
-
复制青色
¥Copy Cyan
-
复制绿色
¥Copy Green
-
复制洋红色
¥Copy Magenta
-
复制不透明度
¥Copy Opacity
-
复制红色
¥Copy Red
-
复制黄色
¥Copy Yellow
-
差异
¥Difference
-
分割
¥Divide
-
在
¥In
-
减号
¥Minus
-
乘法
¥Multiply
-
输出
¥Out
-
覆盖
¥Over
-
附加信息
¥Plus
-
减法
¥Subtract
-
异或
¥Xor
-
位置 X:输入合成图片的 x 轴位置(水平方向)。
¥Position X: Enter the x axis position (horizontal) of the composite image.
- 位置 Y:输入合成图片的 y 轴位置(垂直)。
¥Position Y: Enter the y axis position (vertical) of the composite image.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
创建参数#
¥Create parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 背景颜色:设置图片的背景颜色。你可以输入十六进制代码或选择色板来打开颜色选择器。
¥Background Color: Set the background color for the image. You can either enter a hex or select the color swatch to open a color picker.
- 图片宽度:输入图片宽度。
¥Image Width: Enter the width of the image.
- 图片高度:输入图片的高度。
¥Image Height: Enter the height of the image.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
Crop 参数#
¥Crop parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 宽度:输入要裁剪到的宽度。
¥Width: Enter the width you'd like to crop to.
- 高度:输入要裁剪到的高度。
¥Height: Enter the height you'd like to crop to.
- 位置 X:输入裁剪的起始 x 轴位置(水平)。
¥Position X: Enter the x axis position (horizontal) to start the crop from.
- 位置 Y:输入要开始裁剪的 y 轴位置(垂直方向)。
¥Position Y: Enter the y axis position (vertical) to start the crop from.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
绘制参数#
¥Draw parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 基本权限:选择要绘制的图元形状。选择以下选项:
¥Primitive: Select the primitive shape to draw. Choose from:
-
圆形
¥Circle
-
Line
-
矩形
¥Rectangle
-
颜色:设置图元颜色。你可以输入十六进制代码或选择色板来打开颜色选择器。
¥Color: Set the color for the primitive. You can either enter a hex or select the color swatch to open a color picker.
- 起始位置 X:输入绘制的起始 x 轴位置(水平方向)。
¥Start Position X: Enter the x axis position (horizontal) to start drawing from.
- 起始位置 Y:输入要开始绘制的 y 轴位置(垂直方向)。
¥Start Position Y: Enter the y axis position (vertical) to start drawing from.
- 结束位置 X:输入绘制的结束 x 轴位置(水平)。
¥End Position X: Enter the x axis position (horizontal) to stop drawing at.
- 结束位置 Y:输入绘制的起始 y 轴位置(垂直)。
¥End Position Y: Enter the y axis position (vertical) to start drawing at.
- 圆角半径:输入一个数字,用于设置圆角半径。添加圆角半径将使绘制的图元的边角变圆。
¥Corner Radius: Enter a number to set the corner radius. Adding a corner radius will round the corners of the drawn primitive.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
获取信息参数#
¥Get Information parameters
对于此操作,你只需添加存储图片数据的二进制属性的属性名称。
¥For this operation, you only need to add the Property Name of the binary property that stores the image data.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
多步骤参数#
¥Multi Step parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 操作:添加你希望多步骤操作执行的操作。你可以使用其他任何操作。
¥Operations: Add the operations you want the multi step operation to perform. You can use any of the other operations.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
调整参数大小#
¥Resize parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 宽度:输入你希望图片的新宽度。
¥Width: Enter the new width you'd like for the image.
- 高度:输入你希望图片的新高度。
¥Height: Enter the new height you'd like for the image.
- 选项:选择你希望如何调整图片大小。选择以下选项:
¥Option: Select how you'd like to resize the image. Choose from:
-
忽略宽高比:忽略宽高比,并调整为输入的精确高度和宽度。
¥Ignore Aspect Ratio: Ignore the aspect ratio and resize to the exact height and width you've entered.
-
最大区域:你输入的高度和宽度是图片的最大区域/尺寸。图片将保持其宽高比,并且不会大于你输入的高度和/或宽度。
¥Maximum Area: The height and width you've entered is the maximum area/size for the image. The image maintains its aspect ratio and won't be larger than the height and/or width you've entered.
-
最小面积:你输入的高度和宽度是图片的最小区域/尺寸。图片将保持其宽高比,并且不会小于你输入的高度和/或宽度。
¥Minimum Area: The height and width you've entered is the minimum area/size for the image. The image maintains its aspect ratio and won't be smaller than the height and/or width you've entered.
-
仅当较大时:仅当图片的宽度和高度大于你输入的宽度和高度时才调整图片大小。图片将保持其宽高比。
¥Only if Larger: Resize the image only if it's larger than the width and height you entered. The image maintains its aspect ratio.
-
仅当较小时:仅当图片的宽度和高度小于你输入的宽度和高度时才调整图片大小。图片将保持其宽高比。
¥Only if Smaller: Resize the image only if it's smaller than the width and height you entered. The image maintains its aspect ratio.
-
百分比:使用原始图片的宽度和高度的百分比来调整图片大小。
¥Percent: Resize the image using the width and height as percentages of the original image.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
轮换参数#
¥Rotate parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 旋转:输入图片旋转的角度,范围从 -360 到 360。
¥Rotate: Enter the number of degrees to rotate the image, from --360 to 360.
- 背景颜色:设置图片的背景颜色。你可以输入十六进制代码或选择色板来打开颜色选择器。当图片旋转 90 度的倍数时,此颜色用于填充空白背景。如果“旋转”字段使用 90 度的倍数,则不会使用背景颜色。
¥Background Color: Set the background color for the image. You can either enter a hex or select the color swatch to open a color picker. This color is used to fill in the empty background whenever the image is rotated by multiples of 90 degrees. If multipled of 90 degrees are used for the Rotate field, the background color isn't used.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
剪切参数#
¥Shear parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- X 轴度数:输入图片绕 x 轴倾斜的角度。
¥Degrees X: Enter the number of degrees to shear from the x axis.
- Y 轴度数:输入图片绕 y 轴倾斜的角度。
¥Degrees Y: Enter the number of degrees to shear from the y axis.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
文本参数#
¥Text parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 文本:输入要写入图片的文本。
¥Text: Enter the text you'd like to write on the image.
- 字体大小:选择文本的字体大小。
¥Font Size: Select the font size for the text.
- 字体颜色:设置字体颜色。你可以输入十六进制代码或选择色板来打开颜色选择器。
¥Font Color: Set the font color. You can either enter a hex or select the color swatch to open a color picker.
- 位置 X:输入文本的起始 x 轴位置(水平方向)。
¥Position X: Enter the x axis position (horizontal) to begin the text at.
- 位置 Y:输入文本的起始 y 轴位置(垂直)。
¥Position Y: Enter the y axis position (vertical) to begin the text at.
- 最大行长度:输入每行最多可以输入的字符数(超过此限制将自动换行)。
¥Max Line Length: Enter the maximum amount of characters in a line before adding a line break.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
透明参数#
¥Transparent parameters
- 属性名称:输入存储图片数据的二进制属性名称。
¥Property Name: Enter the name of the binary property that stores the image data.
- 颜色:设置透明颜色。你可以输入十六进制代码或选择色板来打开颜色选择器。
¥Color: Set the color to make transparent. You can either enter a hex or select the color swatch to open a color picker.
有关可选配置选项,请参阅 节点选项。
¥Refer to Node options for optional configuration options.
节点选项#
¥Node options
- 文件名:输入输出文件的文件名。
¥File Name: Enter the filename of the output file.
- 格式:输入输出文件的图片格式。选择以下选项:
¥Format: Enter the image format of the output file. Choose from:
-
bmp
-
gif
-
jpeg
-
png
-
tiff
-
WebP
文本操作还包括字体名称或 ID 选项。从下拉列表中选择文本字体,或使用 expression 指定 ID。
¥The Text operation also includes the option for Font Name or ID. Select the text font from the dropdown or specify an ID using an expression.
模板和示例#
¥Templates and examples