# Convert between NV12 and RGB888 with `qrb_ros_colorspace_convert` The `qrb_ros_colorspace_convert` sample application converts between NV12 and RGB888 formats. Qualcomm's smart devices, such as the Qualcomm Dragonwing^TM^ RB3 Gen 2 development kits, use NV12 as the default image color space conversion format. However, the more common color space format is RGB888. The `qrb_ros_colorspace_convert` sample application implements the following: - Provides ROS nodes > > > - API to convert NV12 to RGB888 > - API to convert RGB888 to NV12 - Supports `dmabuf` fd as input and output - Input and output image receive and send with QRB ROS transport - Hardware acceleration with GPU by OpenGL ES ## Pipeline flow for `qrb_ros_colorspace_convert` The figure shows the pipeline for `qrb_ros_colorspace_convert`.
/image_raw
/image
Publisher
Subscriber
colorspace_convert node
qrb_ros_transport
Subscriber
qrb_ros_transport
Publisher
Custom ROS node
Dependent lib
Topic
Internal module
ROS node
fd
fd
**Figure : `qrb_ros_colorspace_convert` pipeline** ## ROS nodes used in the `qrb_ros_colorspace_convert` pipeline | ROS Node | Description | | --- | --- | | `custom_ros_node` | `custom_ros_node` is the ROS package that publishes the input image information to the colorspace\_convert\_node. You should implement this ROS2 node. | | `colorspace_convert_node` | `colorspace_convert_node` is a ROS package to convert color space between NV12 and RGB888. | ## ROS topics used in the `qrb_ros_colorspace_convert` pipeline | ROS topic | Message type | Published/Subscribed by | Description | | --- | --- | --- | --- | | `/image_raw` | `sensor_msgs::msg::Image` | Subscribes to images from other nodes | The input NV12/RGB888 encoded image. | | `/image` | `sensor_msgs::msg::Image` | Published by `colorspace_convert_node` | Publishes the converted NV12/RGB888 encoded image. | ## Prerequisites - You have **Set up the device** according to [Set up the environment for running sample applications](https://docs.qualcomm.com/doc/80-70030-265/topic/quick_start.html#setup-demo-qs). - The `custom_ros_node` is ready. - You have connected the device to the display monitor. ## Run out-of-the-box `qrb_ros_colorspace_convert` **Steps:** 1. Set up the runtime environment. Value range of `ROS_DOMAIN_ID`: [0, 232] # Set up the runtime environment (ssh) source /usr/share/qirp-setup.sh (ssh) export ROS_DOMAIN_ID=xx # Set up the Weston environment (ssh) export XDG_RUNTIME_DIR=/dev/socket/weston/ (ssh) mkdir -p $XDG_RUNTIME_DIR (ssh) export WAYLAND_DISPLAY=wayland-1 # Set up the shared memory (ssh) export FASTRTPS_DEFAULT_PROFILES_FILE=/usr/share/qrb_ros_colorspace_convert/config/large_message_profile.xml Copy to clipboard 2. Run the sample `qrb_ros_colorspace_convert`. # To convert color space from NV12 to RGB888, run the following command (ssh) ros2 launch qrb_ros_colorspace_convert colorspace_convert.launch.py 'conversion_type:=nv12_to_rgb8' 'latency_fps_test:=False' # To convert color space from RGB888 to NV12, run the following command (ssh) ros2 launch qrb_ros_colorspace_convert colorspace_convert.launch.py 'conversion_type:=rgb8_to_nv12' 'latency_fps_test:=False' Copy to clipboard **Result** Use the following command to confirm the color space conversion Result. > > > (ssh) ros2 topic echo /image_raw | grep "encoding" > (ssh) ros2 topic echo /image | grep "encoding" > Copy to clipboard Last Published: Jul 23, 2026 [Previous Topic Run a zero-copy camera with qrb\_ros\_camera](https://docs.qualcomm.com/bundle/publicresource/80-70030-265/topics/qrb-ros-camera.md) [Next Topic Bridge ROS and GST with ros-gst-bridge](https://docs.qualcomm.com/bundle/publicresource/80-70030-265/topics/ros-gst-bridge.md)