class_docstr: Simple Env wrapper to override observations with rendered rgb values.
code: def __init__(
      self,
      env,
      mode="rgb_array",
      low=0,
      high=255,
      resize_to=None,
      output_dtype=None,
  ):
      gym.Wrapper.__init__(self, env)
      # Get a sample frame to correctly set observation space
      self.mode = mode
      sample_frame = self.render(mode=self.mode)
      assert sample_frame is not None
      self.should_resize = False
      self.output_dtype = output_dtype
      if resize_to is None:
          self.observation_space = gym.spaces.Box(
              low=low,
              high=high,
              shape=sample_frame.shape,
              dtype=sample_frame.dtype,
          )
      else:
          assert len(resize_to) == 2
          self.should_resize = True
          num_channels = sample_frame.shape[-1]
          self.observation_space = gym.spaces.Box(
              low=low,
              high=high,
              shape=list(resize_to) + [num_channels],
              dtype=sample_frame.dtype,
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl import logging
  import gym
  import gym.wrappers
  import numpy
  from PIL import Image
label_desc: Use image node_id 1 to create a new RenderedEnv object from inherited base classes: gym with example: obj = RenderedEnv(env, mode, low, high, resize_to, output_dtype)