😺NKD Lens Blur:
The NKDLensBlurNode is a specialized tool designed to apply a lens blur effect to images, simulating the depth of field effect commonly seen in photography. This node leverages depth information to create a realistic blur that varies across the image, enhancing the perception of depth and focus. By using a combination of RGB and depth data, the node can selectively blur areas of an image based on their distance from a focal plane, allowing for creative control over the focus and blur intensity. This capability is particularly beneficial for artists looking to add a professional touch to their digital artwork, as it mimics the natural blurring effect of a camera lens, thereby adding a layer of realism and depth to the visual composition.
😺NKD Lens Blur Input Parameters:
rgb
The rgb parameter is an image input that represents the color data of the image you wish to apply the lens blur effect to. This parameter is crucial as it provides the base image upon which the blur effect will be applied. The image should be in a standard RGB format, and its dimensions will determine the scale and application of the blur effect.
depth
The depth parameter is another image input that provides depth information for the corresponding rgb image. This depth map is used to determine which parts of the image should be in focus and which should be blurred. The depth values typically range from 0 to 1, where values closer to 0 represent areas closer to the camera, and values closer to 1 represent areas further away. This parameter is essential for achieving a realistic depth of field effect.
blur_config
The blur_config parameter is an optional string input that allows you to customize the blur effect through a JSON configuration. This configuration can include settings such as blurStrength, fieldOfDepth, focusX, focusY, and focalOffset. These settings control the intensity of the blur, the depth range that remains in focus, and the focal point within the image. The default value is an empty JSON object {}, which applies default settings.
unique_id
The unique_id is a hidden parameter used internally to track and manage the processing of images. It is not typically set by the user but is used by the system to ensure that the correct image data is processed and returned.
😺NKD Lens Blur Output Parameters:
blurred_image
The blurred_image output is the final image with the lens blur effect applied. This image retains the original dimensions and color data of the input rgb image but with the added depth of field effect. The output is an enhanced version of the input image, with certain areas blurred based on the depth information, creating a more dynamic and visually appealing result.
😺NKD Lens Blur Usage Tips:
- To achieve a more pronounced depth of field effect, adjust the
blurStrengthandfieldOfDepthsettings in theblur_config. A higherblurStrengthwill increase the intensity of the blur, while a smallerfieldOfDepthwill narrow the range of focus. - Experiment with the
focusXandfocusYparameters to shift the focal point within the image. This can help emphasize different areas of the image and create a more engaging composition.
😺NKD Lens Blur Common Errors and Solutions:
JSONDecodeError in blur_config
- Explanation: This error occurs when the
blur_configstring is not a valid JSON format, which prevents the node from parsing the configuration settings. - Solution: Ensure that the
blur_configstring is correctly formatted as JSON. Check for missing brackets, commas, or quotation marks, and validate the JSON structure before inputting it into the node.
Mismatched Image Dimensions
- Explanation: This error arises when the dimensions of the
rgbanddepthimages do not match, which can lead to incorrect application of the blur effect. - Solution: Ensure that both the
rgbanddepthimages have the same width and height. If necessary, resize one of the images to match the other before processing.
