import CoreGraphics import Foundation extension CGImage { var size: CGSize { return .init(width: width, height: height) } }