code: func PictureDataFromPicture(pic Picture) *PictureData {
  	if pd, ok := pic.(*PictureData); ok {
  		return pd
  	}
  
  	bounds := pic.Bounds()
  	pd := MakePictureData(bounds)
  
  	if pic, ok := pic.(PictureColor); ok {
  		for y := math.Floor(bounds.Min.Y); y < bounds.Max.Y; y++ {
  			for x := math.Floor(bounds.Min.X); x < bounds.Max.X; x++ {
  				// this together with the Floor is a trick to get all of the pixels
  				at := V(
  					math.Max(x, bounds.Min.X),
  					math.Max(y, bounds.Min.Y),
  				)
  				col := pic.Color(at)
  				pd.Pix[pd.Index(at)] = color.RGBA{
  					R: uint8(col.R * 255),
  					G: uint8(col.G * 255),
  					B: uint8(col.B * 255),
  					A: uint8(col.A * 255),
  				}
  			}
  		}
  	}
  
  	return pd
  }
docs: // PictureDataFromPicture converts an arbitrary Picture into PictureData (the conversion may be
  // lossy, because PictureData works with unit-sized pixels).
  //
  // Bounds are preserved.