The ImageBitmap.close() method disposes of all graphical resources associated with an ImageBitmap.
ImageBitmap.close()
ImageBitmap
MDN Reference