I'm taking a "snapshot" of the image context in UIGraphicsBeginImageContextWithOptions(UIScreen.mainScreen().bounds.size, true, 0)
and eventually creating a UIImage
using
var renderedImage = UIGraphicsGetImageFromCurrentImageContext()
However I need to get the NSData representation of this UIImage without using UIImageJPEGRepresentation
or UIImagePNGRepresentation
(because these produce files that are way larger than the original UIImage). How can I do this?