import UIKit func renderPixelSize(_ view: UIView) -> [Int32] { let scale = view.contentScaleFactor let w = Int32(max(1, (view.bounds.width * scale).rounded())) let h = Int32(max(1, (view.bounds.height * scale).rounded())) return [w, h] }