title: How to predict or calculate the file-size of an image (NSImage) when written to disk?
body: <p>The question say's it all.</p>
  
  <p>How can I predict in Swift4.2 or at least in Swift4 the file-size of an image in an NSImage or NSImageView.image?</p>
  
  <p>I can't find anything about this is the Apple docs.</p>
  
  <p>Should I convert it to some kind of (NS)Data representation or...</p>
  
  <p>..should I save the image to disk, check the size with FileManager, do my thing, and resave the file?</p>