R/attributes.R

Defines functions image_info image_comment

Documented in image_comment image_info

#' Image Attributes
#'
#' Attributes are properties of the image that might be present on some images
#' and might affect image manipulation methods.
#'
#' Each attribute can be get and set with the same function. The [image_info()]
#' function returns a data frame with some commonly used attributes.
#'
#' @export
#' @family image
#' @inheritParams editing
#' @name attributes
#' @rdname attributes
#' @param comment string to set an image comment
image_comment <- function(image, comment = NULL){
  assert_image(image)
  comment <- as.character(comment)
  magick_attr_comment(image, comment)
}

#' @export
#' @rdname attributes
image_info <- function(image){
  assert_image(image)
  df <- magick_image_info(image)
  df_to_tibble(df)
}

Try the magick package in your browser

Any scripts or data that you put into this service are public.

magick documentation built on Oct. 22, 2023, 5:06 p.m.