multicolorfits.save_transparent_cutout#

multicolorfits.save_transparent_cutout(rgba, savepath, overwrite=True)[source]#

Write an RGBA cutout to PNG or TIFF (format from the file extension).

Arrays in this package use FITS / matplotlib origin='lower' (row 0 at the bottom). Files are written vertically flipped so typical image viewers (and HTML <img>) show the same sky orientation as a matplotlib imshow(..., origin='lower') plot. In-memory arrays returned by make_transparent_cutout() are not flipped.

Parameters:
  • rgba (array (ny, nx, 4)) – Float [0, 1] or uint8 (origin lower-left).

  • savepath (str) – .png or .tif / .tiff.

  • overwrite (bool)

Returns:

str – Absolute path written.