Add an Image Processing Pipeline
CreatiCode last edited by
If you are working on an art project, you often would like to make your scene look beautiful. This can be done using an “image processing pipeline”. The idea is to take the image stream captured by the camera, and change them before showing them on the screen. Note that this is a 2D operation, as we are not changing the 3D objects in the scene, but rather modifying the 2D images captured by the camera.
Since we can apply a sequence of operations on these images, it is called a “pipeline”.
The “Add Pipeline” Block
You can run this block anytime after the scene and camera are ready to add the image processing pipeline:
You can run this block multiple times. Each time, the previous pipeline will be removed first, so the operations won’t be applied more than once.
Each operation is explained below. To show the effect, we’ll use a motorcycle model like this:
And after applying the image processing pipeline, you can produce a result like this:
You can open this project to view the scene and experiment with the pipeline:
The vignette effect will make the 4 borders of the image darker and blurry, thus highlighting the area in the center.
In the block, you can specify the size and color of the vignette effect:
- The size of the vignette controls the size of the affected area in the 4 borders.
- The color of the vignette is the color being painted in the borders.
Here are the results from different sizes and colors:
The bloom effect is used to highlight the bright areas in an image. The idea is that sometimes it is hard for the camera to capture an area that is very bright, because it would just show up as white colors. To solve this problem, we can make the area around the bright spots glow lights as well, so those spots would appear really bright.
There are 3 inputs that control the bloom effect:
The strength controls the intensity of the lights we add. When it is 0, no bloom effect is applied.
The threshold controls which parts of the image are treated as bright spots that would glow lights. If a spot on the image is brighter than the threshold, then it will glow lights under the bloom effect. When the threshold is 0, that means all areas in the image will be glowing lights.
The kernel controls how to spread the glowing lights around the bright spots. The larger the kernel, the bigger the glowing area, but also the less intense effect.
Note that larger kernels will require significantly more computations, so usually you should keep it below 16.
When the computer screen displays an image, it will divide the image into many tiny squares called “pixels”, and draw each pixel with a different color. This leads to the problem that curved edges in the image may appear jagged:
If you set antialiasing to “yes”, then these pixels will be blurred up to make the edges look smoother:
Sometimes due to low resolution, the edges in an image may appear blurry, such as the bricks on the ground:
You can make the edges in the image sharper by setting “sharpening” to “yes”:
The contrast refers to the relative difference between the bright areas and the dark areas. An image will look more lively if there is a high contrast. You can use the “camera contrast” input to change the contrast of the image. By default it is at 100, which means no change is made. If the value is less than 100, the image will become foggy; if the value is more than 100, the image will look more clear.
The exposure value controls the brightness of an image. The normal exposure value is 100. If it is more than 100, the image will become overly bright; at less than 100, the image will appear dark.
Remove the Pipeline
To turn off all the image processing operations, you can run the following block: