/** * Edit Image Node - Version 1 * Edits an image like blur, resize or adding border and text */ export interface EditImageV1Params { operation?: 'blur' | 'border' | 'composite' | 'create' | 'crop' | 'draw' | 'information' | 'multiStep' | 'resize' | 'rotate' | 'shear' | 'text' | 'transparent'; /** * Name of the binary property in which the image data can be found * @default data */ dataPropertyName?: string | Expression | PlaceholderValue; /** * The operations to perform * @displayOptions.show { operation: ["multiStep"] } * @default {} */ operations?: { /** Operations */ operations?: Array<{ /** Operation */ operation?: 'blur' | 'border' | 'composite' | 'create' | 'crop' | 'draw' | 'rotate' | 'resize' | 'shear' | 'text' | 'transparent'; /** The background color of the image to create * @displayOptions.show { operation: ["create"] } * @default #ffffff00 */ backgroundColor?: string | Expression; /** The width of the image to create * @displayOptions.show { operation: ["create"] } * @default 50 */ width?: number | Expression; /** The height of the image to create * @displayOptions.show { operation: ["create"] } * @default 50 */ height?: number | Expression; /** The primitive to draw * @displayOptions.show { operation: ["draw"] } * @default rectangle */ primitive?: 'circle' | 'line' | 'rectangle' | Expression; /** The color of the primitive to draw * @displayOptions.show { operation: ["draw"] } * @default #ff000000 */ color?: string | Expression; /** X (horizontal) start position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 50 */ startPositionX?: number | Expression; /** Y (horizontal) start position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 50 */ startPositionY?: number | Expression; /** X (horizontal) end position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 250 */ endPositionX?: number | Expression; /** Y (horizontal) end position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 250 */ endPositionY?: number | Expression; /** The radius of the corner to create round corners * @displayOptions.show { operation: ["draw"], primitive: ["rectangle"] } * @default 0 */ cornerRadius?: number | Expression; /** Text to write on the image * @displayOptions.show { operation: ["text"] } */ text?: string | Expression | PlaceholderValue; /** Size of the text * @displayOptions.show { operation: ["text"] } * @default 18 */ fontSize?: number | Expression; /** Color of the text * @displayOptions.show { operation: ["text"] } * @default #000000 */ fontColor?: string | Expression; /** X (horizontal) position of the text * @displayOptions.show { operation: ["text"] } * @default 50 */ positionX?: number | Expression; /** Y (vertical) position of the text * @displayOptions.show { operation: ["text"] } * @default 50 */ positionY?: number | Expression; /** Max amount of characters in a line before a line-break should get added * @displayOptions.show { operation: ["text"] } * @default 80 */ lineLength?: number | Expression; /** How strong the blur should be * @displayOptions.show { operation: ["blur"] } * @default 5 */ blur?: number | Expression; /** The sigma of the blur * @displayOptions.show { operation: ["blur"] } * @default 2 */ sigma?: number | Expression; /** The width of the border * @displayOptions.show { operation: ["border"] } * @default 10 */ borderWidth?: number | Expression; /** The height of the border * @displayOptions.show { operation: ["border"] } * @default 10 */ borderHeight?: number | Expression; /** Color of the border * @displayOptions.show { operation: ["border"] } * @default #000000 */ borderColor?: string | Expression; /** The name of the binary property which contains the data of the image to composite on top of image which is found in Property Name * @displayOptions.show { operation: ["composite"] } */ dataPropertyNameComposite?: string | Expression | PlaceholderValue; /** The operator to use to combine the images * @displayOptions.show { operation: ["composite"] } * @default Over */ operator?: 'Add' | 'Atop' | 'Bumpmap' | 'Copy' | 'CopyBlack' | 'CopyBlue' | 'CopyCyan' | 'CopyGreen' | 'CopyMagenta' | 'CopyOpacity' | 'CopyRed' | 'CopyYellow' | 'Difference' | 'Divide' | 'In' | 'Minus' | 'Multiply' | 'Out' | 'Over' | 'Plus' | 'Subtract' | 'Xor' | Expression; /** X (horizontal) position of composite image * @displayOptions.show { operation: ["composite"] } * @default 0 */ positionX?: number | Expression; /** Y (vertical) position of composite image * @displayOptions.show { operation: ["composite"] } * @default 0 */ positionY?: number | Expression; /** Crop width * @displayOptions.show { operation: ["crop"] } * @default 500 */ width?: number | Expression; /** Crop height * @displayOptions.show { operation: ["crop"] } * @default 500 */ height?: number | Expression; /** X (horizontal) position to crop from * @displayOptions.show { operation: ["crop"] } * @default 0 */ positionX?: number | Expression; /** Y (vertical) position to crop from * @displayOptions.show { operation: ["crop"] } * @default 0 */ positionY?: number | Expression; /** New width of the image * @displayOptions.show { operation: ["resize"] } * @default 500 */ width?: number | Expression; /** New height of the image * @displayOptions.show { operation: ["resize"] } * @default 500 */ height?: number | Expression; /** How to resize the image * @displayOptions.show { operation: ["resize"] } * @default maximumArea */ resizeOption?: 'ignoreAspectRatio' | 'maximumArea' | 'minimumArea' | 'onlyIfLarger' | 'onlyIfSmaller' | 'percent' | Expression; /** How much the image should be rotated * @displayOptions.show { operation: ["rotate"] } * @default 0 */ rotate?: number | Expression; /** The color to use for the background when image gets rotated by anything which is not a multiple of 90 * @displayOptions.show { operation: ["rotate"] } * @default #ffffffff */ backgroundColor?: string | Expression; /** X (horizontal) shear degrees * @displayOptions.show { operation: ["shear"] } * @default 0 */ degreesX?: number | Expression; /** Y (vertical) shear degrees * @displayOptions.show { operation: ["shear"] } * @default 0 */ degreesY?: number | Expression; /** The color to make transparent * @displayOptions.show { operation: ["transparent"] } * @default #ff0000 */ color?: string | Expression; /** The font to use. Defaults to Arial. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. * @displayOptions.show { operation: ["text"] } */ font?: string | Expression; }>; }; /** * The background color of the image to create * @displayOptions.show { operation: ["create"] } * @default #ffffff00 */ backgroundColor?: string | Expression; /** * The width of the image to create * @displayOptions.show { operation: ["create"] } * @default 50 */ width?: number | Expression; /** * The height of the image to create * @displayOptions.show { operation: ["create"] } * @default 50 */ height?: number | Expression; /** * The primitive to draw * @displayOptions.show { operation: ["draw"] } * @default rectangle */ primitive?: 'circle' | 'line' | 'rectangle' | Expression; /** * The color of the primitive to draw * @displayOptions.show { operation: ["draw"] } * @default #ff000000 */ color?: string | Expression; /** * X (horizontal) start position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 50 */ startPositionX?: number | Expression; /** * Y (horizontal) start position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 50 */ startPositionY?: number | Expression; /** * X (horizontal) end position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 250 */ endPositionX?: number | Expression; /** * Y (horizontal) end position of the primitive * @displayOptions.show { operation: ["draw"], primitive: ["circle", "line", "rectangle"] } * @default 250 */ endPositionY?: number | Expression; /** * The radius of the corner to create round corners * @displayOptions.show { operation: ["draw"], primitive: ["rectangle"] } * @default 0 */ cornerRadius?: number | Expression; /** * Text to write on the image * @displayOptions.show { operation: ["text"] } */ text?: string | Expression | PlaceholderValue; /** * Size of the text * @displayOptions.show { operation: ["text"] } * @default 18 */ fontSize?: number | Expression; /** * Color of the text * @displayOptions.show { operation: ["text"] } * @default #000000 */ fontColor?: string | Expression; /** * X (horizontal) position of the text * @displayOptions.show { operation: ["text"] } * @default 50 */ positionX?: number | Expression; /** * Y (vertical) position of the text * @displayOptions.show { operation: ["text"] } * @default 50 */ positionY?: number | Expression; /** * Max amount of characters in a line before a line-break should get added * @displayOptions.show { operation: ["text"] } * @default 80 */ lineLength?: number | Expression; /** * How strong the blur should be * @displayOptions.show { operation: ["blur"] } * @default 5 */ blur?: number | Expression; /** * The sigma of the blur * @displayOptions.show { operation: ["blur"] } * @default 2 */ sigma?: number | Expression; /** * The width of the border * @displayOptions.show { operation: ["border"] } * @default 10 */ borderWidth?: number | Expression; /** * The height of the border * @displayOptions.show { operation: ["border"] } * @default 10 */ borderHeight?: number | Expression; /** * Color of the border * @displayOptions.show { operation: ["border"] } * @default #000000 */ borderColor?: string | Expression; /** * The name of the binary property which contains the data of the image to composite on top of image which is found in Property Name * @displayOptions.show { operation: ["composite"] } */ dataPropertyNameComposite?: string | Expression | PlaceholderValue; /** * The operator to use to combine the images * @displayOptions.show { operation: ["composite"] } * @default Over */ operator?: 'Add' | 'Atop' | 'Bumpmap' | 'Copy' | 'CopyBlack' | 'CopyBlue' | 'CopyCyan' | 'CopyGreen' | 'CopyMagenta' | 'CopyOpacity' | 'CopyRed' | 'CopyYellow' | 'Difference' | 'Divide' | 'In' | 'Minus' | 'Multiply' | 'Out' | 'Over' | 'Plus' | 'Subtract' | 'Xor' | Expression; /** * How to resize the image * @displayOptions.show { operation: ["resize"] } * @default maximumArea */ resizeOption?: 'ignoreAspectRatio' | 'maximumArea' | 'minimumArea' | 'onlyIfLarger' | 'onlyIfSmaller' | 'percent' | Expression; /** * How much the image should be rotated * @displayOptions.show { operation: ["rotate"] } * @default 0 */ rotate?: number | Expression; /** * X (horizontal) shear degrees * @displayOptions.show { operation: ["shear"] } * @default 0 */ degreesX?: number | Expression; /** * Y (vertical) shear degrees * @displayOptions.show { operation: ["shear"] } * @default 0 */ degreesY?: number | Expression; /** * Options * @displayOptions.hide { operation: ["information"] } * @default {} */ options?: { /** The name of the output field that will contain the file data * @default data */ destinationKey?: string | Expression | PlaceholderValue; /** File name to set in binary data */ fileName?: string | Expression | PlaceholderValue; /** The font to use. Defaults to Arial. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>. * @displayOptions.show { /operation: ["text"] } */ font?: string | Expression; /** Set the output image format * @default jpeg */ format?: 'bmp' | 'gif' | 'jpeg' | 'png' | 'tiff' | 'webp' | Expression; /** Sets the jpeg|png|tiff compression level from 0 to 100 (best) * @displayOptions.show { format: ["jpeg", "png", "tiff"] } * @default 100 */ quality?: number | Expression; }; } interface EditImageV1NodeBase { type: 'n8n-nodes-base.editImage'; version: 1; } export type EditImageV1ParamsNode = EditImageV1NodeBase & { config: NodeConfig; }; export type EditImageV1Node = EditImageV1ParamsNode;