diff --git a/Code/Visualization/otbStandardRenderingFunction.h b/Code/Visualization/otbStandardRenderingFunction.h
index f4a73e608866eacc84b7b7e6fb72edcaa91ae2b4..05054f65b3fbffea78091bb3b84c187168739e4c 100644
--- a/Code/Visualization/otbStandardRenderingFunction.h
+++ b/Code/Visualization/otbStandardRenderingFunction.h
@@ -122,7 +122,7 @@ public:
     */
   virtual OutputPixelType EvaluateTransferFunction(const InternalPixelType &  spixel) const
   {
-    if ((spixel.Size() != 1) && (spixel.Size() != 3) && (spixel.Size() != 4))
+    if ((spixel.Size() != 1) && (spixel.Size() != 3) && (spixel.Size() != 2)&& (spixel.Size() != 4))
     {
       itkExceptionMacro( << "the PixelRepresentation function should give an output of "
        << "size 1, 3 or 4 otherwise I don't know how to make an RGB of it !" );