Circle Image

Pixaflux

Tutorial Double Border

The Double Border Node Graph project

Load the project Double_Border.pxf.

Visual Scripting Double Border

This project applies a two color border to an image and it contains all the necessary nodes to be reused in other projects:

This project is saved in a file Double_Border.pxf.

Reusing the Double Border node graph

  1. Create a new empty project. File > New > Empty Project
  2. Create an Node Graph node Geometry icon Arrow Image Set Pivot icon.
  3. Click the Path button and load the Double_Border.pxf project. Double click the node to reactivate it and display all its attribute, inputs and outputs.
  4. Drag and drop an image into the project to create a Reader node.
  5. Connect [Reader › image] to [image › Double_Border].
  6. Set the size and color of the border.

Double Border

This Double_Border node applies the two borders to the image with the border size and colors defined in the attributes of the Node Graph node.

Adding More Borders

You will now modify the Double_Border.pxf project to add more borders to the image using multiple loops. Each border will be one size larger than the previous border.

  1. Load the Double_Border.pxf project.
  2. Create a new Loop Iterations node. This node has two number outputs, the current iteration and the number of iterations. The attributes of this node can be used to test the behavior of the node graph at different iterations.
  3. Create a new Number Multiply node.
  4. Connect [Loop Iterations › iteration] to [number_a › Number Multiply]. The Number Multiply node will multiply the size of the border by the current iteration.
  5. Connect [Number Multiply › number] to [size › Border].
  6. Connect [Number Multiply › number] to [size › Border].
  7. Resize the Node Frames and add a new Node Frame for the Loop Iterations node.
  8. Modify the Loop Iterations Iteration attribute to see how the border size changes on each iteration.
  9. Save this project as DoubleBorderLoop.pxf.

Double Border Loop

Testing the Double Border Loop Project

In a new project create a new Reader node with an image and a new Node Graph node. Load the DoubleBorderLoop.pxf project in this node.

Increase the number of iterations in the DoubleBorderLoop node.

Testing Double Border Loop

There is something wrong. The DoubleBorderLoop node is not applying multiple borders, instead it is creating a larger border.

This happens because by default the Node Graph node applies the same node graph to the same input image, and each iteration makes the border larger.

To fix the effect you need to tell the Node Graph node that the new border has to be applied to image generated in the previous loop.

Fixing the Double Border Loop Project

Load the DoubleBorderLoop.pxf project.

  1. Activate the input Image IO node and rename it image.
  2. Activate the output Image IO node and rename it image.

Testing the Double Border Loop Project

In a new project create a new Reader node with an image and a new Node Graph node. Load the DoubleBorderLoop.pxf project in this node.

Increase the number of iterations in the DoubleBorderLoop node.

Testing Double Border Loop Fixed

Creating a Custom Node from the Double Border project

Now that you have a node graph project that can be reused, you can create a new custom node and use it in PixaFlux as any other node.

Note: If you installed PixaFlux in the Program Files directory you'll need Administrator access to add the new files to the PixaFlux program directory. This tutorial assumes that PixaFlux was installed in:


c:\Program Files\PixaFlux

Custom Node Directory

Create a new DoubleBorder directory in (PixaFlux)/Resources/Nodes:


C:\Program Files\PixaFlux\Resources\Nodes\DoubleBorder

info.txt

Create a new info.txt file in the DoubleBorder directory:


C:\Program Files\PixaFlux\Resources\Nodes\DoubleBorder\info.txt

Visit Online GUID Generator and generate a new guid. For example:


6c538cf4-abaf-473e-9ece-e54816b7eb8e

Leave only two 8 hex digit strings:


6c538cf4 abaf473e

Add the 0x hexadecimal number prefix:


0x6c538cf4 0xabaf473e

And copy this hexadecimal identifier to info.txt as the Type:


Type: 0x6c538cf4 0xabaf473e

Add the project file, node name and node group to the file.


Type: 0x6c538cf4 0xabaf473e
Project: Double_Border.pxf
Name: Double Border
Group: Layout

Project file

Copy the Double_Border.pxf file to the Resources\Nodes directory.


C:\Program Files\PixaFlux\Resources\Nodes\DoubleBorder\Double_Border.pxf

Icons

Create the new icons for the Double Border node and save them to the Resources\Nodes directory, or copy these ones:

Nodes Menu icon. 24 x 24 Pixels:

Icon24

Node Graph icon. 12 x 12 Pixels:

Icon24

This are the final directory contents:

Directory

Now restart PixaFlux and look for the new Double Border node in the Layout node group:

Directory

Create a new Double Border node and connect it to the output of an image node.

Directory

Edit the attributes.

Directory

Directory