Image Transformations
The ImageTransformations.jl package contains many useful functions for manipulating astronomical images.
Note however that many of these functions drop the AstroImage wrapper and return plain arrays or OffsetArrays. They can be re-wrapped using copyheader
or shareheader
if you'd like to preserve the FITS header, dimension labels, WCS information, etc.
You can install ImageTransformations by running ] add ImageTransformations
at the REPL.
For these examples, we'll download an image of the Antenae galaxies from Hubble:
using AstroImages
using ImageTransformations
fname = download(
"http://www.astro.uvic.ca/~wthompson/astroimages/fits/antenae/blue.fits",
"ant-blue.fits"
)
antblue = load("ant-blue.fits")
# We'll change the defaults to avoid setting them each time
AstroImages.set_clims!(Percent(99))
AstroImages.set_cmap!(:ice)
AstroImages.set_stretch!(asinhstretch)
imview(antblue)
Rotations
We can rotate images using the imrotate
function.
imrotate(antblue, 3π/4) |> imview