Hide a channel in RenderedImageServer for RGB export

I am trying to export an overlay of the measurement for quick quality control step using the RenderedImageServer. I am using the following example by @petebankhead

As I understand the script gets the display setting from the current open image in the viewer. I have opened one image in the viewer and disabled (hide) one of the channel, when I use this script I still get all channels in the exported image.

My image type is set to FLUORESCENCE , 1920pxx1440px, and I want to hide the Channel 3, which is a phase image, in the exported image. How do I do that ?

Nevermind, found .display(viewer.getImageDisplay())

from this post: