I've been struggling through a few iterations of solutions, trying to get a photo that's been converted to polar coordinates (originally rectangular hemispherical photo) to crop out areas outside of the circle. Initially following this [StackOverflow post]R magick: Square crop and circular mask with no luck. Here's the image I'm working with (in reality there are thousands I must process): 
Here's the function I made:
hemi_rect_to_polar <- function(hemi_rect_image){
hemi_polar <- image_distort(hemi_rect_image,
"Polar",
c(0),
bestfit = TRUE)
min_dim <- min(image_info(hemi_rect_image)[2])
figure <- image_draw(image_blank(min_dim,min_dim))
symbols(min_dim/2,
min_dim/2,
circles = (min_dim/2),
fg = 'black',
add = TRUE)
dev.off()
return(hemi_polar)
}
and the output I got from that function, which has continued colors past the circular boundary that I need to get rid of for later analysis:
I'm not sure why it keeps stretching the polar coordinates past the bounding circle.

