class_docstr: Preprocess screen images from Atari 2600 games.
  
  The image is represented by an array of shape (210, 160, 3). See
  https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf
  for more details.
class_docstr_tok: ["Preprocess","screen","images","from","Atari","2600","games",".","The","image","is","represented","by","an","array","of","shape","(","210",",","160",",","3",")",".","See","https",":","\/\/storage.googleapis.com\/deepmind-media\/dqn\/DQNNaturePaper.pdf","for","more","details","."]
docstr: Return preprocessed screen images from Atari 2600 games.
docstr_tok: ["Return","preprocessed","screen","images","from","Atari","2600","games","."]
code: def preprocess(self, image):
      """Return preprocessed screen images from Atari 2600 games."""
      if image.shape != self._input_shape:
          raise ValueError(
              "Expecting image in shape {0} but get {1}\n".format(
                  self._input_shape, image.shape
              )
          )
  
      # Take the maximum value for each pixel over the current frame and the
      # previous one.
      im = Image.fromarray(
          np.maximum(image, self.__previous_raw_image), mode="RGB"
      )
  
      # Extract luminance band.
      im = im.convert("YCbCr").split()[0]
  
      # Scale to 84 x 84
      im = im.resize((84, 84), Image.BILINEAR)
  
      self.__processed_image_seq.append(np.array(im))
      self.__previous_raw_image = image
  
      return np.stack(list(self.__processed_image_seq))
  
imports: from abc import ABCMeta, abstractmethod
  from collections import deque
  import numpy
  from PIL import Image
label_desc: Use image node_id 4 for calling the AtariPreprocessing obj's underlying member method code with example usage: obj.preprocess(image) and returns: np