code: func (im *Image) SubImage(r image.Rectangle) image.Image {
  	r = r.Intersect(im.Rect)
  	if r.Empty() {
  		return nil
  	}
  
  	i := im.PixOffset(r.Min.X, r.Min.Y)
  	return &Image{
  		X:      im.X,
  		Pixmap: im.Pixmap,
  		Pix:    im.Pix[i:],
  		Stride: im.Stride,
  		Rect:   r,
  		Subimg: true,
  	}
  }
docs: // SubImage provides a sub image of Image without copying image data.
  // N.B. The standard library defines a similar function, but returns an
  // image.Image. Here, we return xgraphics.Image so that we can use the extra
  // methods defined by xgraphics on it.
  //
  // This method is cheap to call. It should be used to update only specific
  // regions of an X pixmap to avoid sending an entire image to the X server when
  // only a piece of it is updated.
  //
  // Note that if the intersection of `r` and `im` is empty, `nil` is returned.