title: MacOS - How to programmatically count bytes for an image in Swift?
body: <p>In my iOS project, in order to count bytes for my png image called &quot;toto&quot; I use this line below in the console:</p>
  <p>print(UIImage(imageLiteralResourceName: &quot;toto&quot;).pngData()!.count)</p>
  <p>But for my MacOS project, UIImage cannot be used so what equivalent can I use to achieve the same result?</p>
  <p>Thanks.</p>