UIImage(data:imageData,scale:1.0)
presuming the image’s scale is 1.
In swift 4.2, use below code for get Data().
image.pngData()
More Related Contents:
- Convert between UIImage and Base64 string
- Swift PNG Image being saved with incorrect orientation
- Loading/Downloading image from URL on Swift
- UIImage(contentsOfFile:) returning nil despite file existing in caches directory [duplicate]
- How do I resize the UIImage to reduce upload image size
- How can I change image tintColor in iOS and WatchKit
- How to Resize image in Swift?
- How do I add text to an image in iOS Swift?
- How to compress of reduce the size of an image before uploading to Parse as PFFile? (Swift)
- Create UIImage with solid color in Swift
- UIImageView – How to get the file name of the image assigned?
- How do I take a full screen Screenshot in Swift?
- How to compress/resize image on iOS before uploading to a server?
- How do I get the color of a pixel in a UIImage with Swift?
- Change color of certain pixels in a UIImage
- Cut a UIImage into a circle
- Rotating UIImage in Swift
- Resize UIImage to 200x200pt/px
- How to set image for bar button with swift?
- Save images with phimagemanager to custom album?
- Get pixel data as array from UIImage/CGImage in swift
- How can I color a UIImage in Swift?
- Pixel Array to UIImage in Swift
- Swift playgrounds with UIImage
- Set custom images to the UIBarButtonItem but it doesn’t show any image
- How do you create a UIImage View Programmatically – Swift
- How to merge two UIImages?
- How to hide UINavigationBar 1px bottom line
- Writing handler for UIAlertAction
- Detect backspace Event in UITextField