diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 11202944bdd6f10430a5923081a62c0bcbfc1be6..6ac28684a85568aec77f238a10e10e0c56d5ad8b 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -201,6 +201,20 @@ static inline QImage::Format imageFormatForVisual(int depth, quint32 red_mask, q
     case 16:
         if (blue_mask == 0x1f)
             return QImage::Format_RGB16;
+        if (red_mask == 0x1f) {
+            if (rgbSwap)
+                *rgbSwap = true;
+            return QImage::Format_RGB16;
+        }
+        break;
+    case 15:
+        if (blue_mask == 0x1f)
+            return QImage::Format_RGB555;
+        if (red_mask == 0x1f) {
+            if (rgbSwap)
+                *rgbSwap = true;
+            return QImage::Format_RGB555;
+        }
         break;
     default:
         break;