Perhaps ou mean this?

        Show[SetAlphaChannel[LinearGradientImage["Rainbow"], 0.5], Axes -> True]

[![enter image description here][1]][1]


----------


As the @J.M.'s promption of `Raster`

    Graphics[{Opacity[.5], 
      Raster[Array[(a = Range[0, 1, 0.01]) &, Length@a], 
       ColorFunction -> "Rainbow"]}]
[![enter image description here][2]][2]


  [1]: https://i.stack.imgur.com/TzFGK.jpg
  [2]: https://i.stack.imgur.com/aD3Px.png