@roaders/node-red-contrib-image-path-crop 1.0.8

Crops an image to an irregular path:

npm install @roaders/node-red-contrib-image-path-crop

Crops an image to an irregular path:

alt text

becomes

alt text

Nodes

Load Image

Loads a given path and outputs it as a Buffer. Buffer can be an input to path-crop-image node and is useful if you want to load an image once but crop it many times.

Inputs

  • path - the path to the image

Path Crop Image

Crops an image to an irregular shaped path.

Inputs

  • image - can be specified as a path to an image which will be loaded or can be specified as a Buffer that has already been loaded. To specify the output of the load-image node the node edit dialog should be set to msg.payload so that the Buffer in the message payload from the previous node can be used.

  • cropPath - An array of points that form the path to be cropped. At least 3 points must be specified. Example:

            [
                {
                    "x": 530,
                    "y": 460
                },
                {
                    "x": 215,
                    "y": 800
                },
                {
                    "x": 933,
                    "y": 800
                }
            ]
  • outputPath - Optional. If set the modified image will be saved to this path.

Inputs for both nodes can be directly specified in the node edit dialog or they can be specified in a message property or in the flow or global context.

Node Info

Version: 1.0.8
Updated 1 year, 1 month ago
License: ISC
Rating: not yet rated

Actions

Rate:

Downloads

11 in the last week

Nodes

  • load-image
  • path-crop-image

Keywords

  • node-red

Maintainers