Background image opacity changes

Hi , Here i want to change opacity of the background image of the grid by changing external input event such as range slider(html input). Can u suggest me how to do it.

To have a background image in a diagram that scales and scrolls along with the rest of the diagram, you need to add a Part holding a Picture. See for example this code from the Kitten Monitor sample, https://gojs.net/latest/samples/kittenMonitor.html

      // the background image, a floor plan
      myDiagram.add(
        $(go.Part,  // this Part is not bound to any model data
          {
            width: 840, height: 570,
            layerName: "Background", position: new go.Point(0, 0),
            selectable: false, pickable: false
          },
          $(go.Picture, "https://upload.wikimedia.org/wikipedia/commons/9/9a/Sample_Floorplan.jpg")
        ));

If you keep a reference to that Part in a variable, you can then set its opacity to a value between 0.0 and 1.0 in your slider’s “change” and “input” event handlers.