---
title: "How to work with images"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{How to work with images}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```


```{r setup}
library(panstarrs)
library(magick)
```

# Example 1

## Plot color image of the Antennae galaxies

```{r}
coords_antennae <- ps1_mast_resolve('Antennae')

ps1_image_color(
  coords_antennae$ra, 
  coords_antennae$dec, 
  format = 'png', 
  size = 600
) |> 
  magick::image_read() |> 
  magick::image_resize("400x400")
```



