code: func NewImageFormat(source string, quiet bool, digest bool) Format {
  	switch source {
  	case TableFormatKey:
  		switch {
  		case quiet:
  			return DefaultQuietFormat
  		case digest:
  			return defaultImageTableFormatWithDigest
  		default:
  			return defaultImageTableFormat
  		}
  	case RawFormatKey:
  		switch {
  		case quiet:
  			return `image_id: {{.ID}}`
  		case digest:
  			return `repository: {{ .Repository }}
  tag: {{.Tag}}
  digest: {{.Digest}}
  image_id: {{.ID}}
  created_at: {{.CreatedAt}}
  virtual_size: {{.Size}}
  `
  		default:
  			return `repository: {{ .Repository }}
  tag: {{.Tag}}
  image_id: {{.ID}}
  created_at: {{.CreatedAt}}
  virtual_size: {{.Size}}
  `
  		}
  	}
  
  	format := Format(source)
  	if format.IsTable() && digest && !format.Contains("{{.Digest}}") {
  		format += "\t{{.Digest}}"
  	}
  	return format
  }
docs: // NewImageFormat returns a format for rendering an ImageContext