1

I have an Image which getting grom user Gallery and I convert this image to Byte Array like

   let imageOther = myImage
    let dataOther = imageOther.jpegData(compressionQuality: 1)

This dataOther type is Data and about 700k KB. I know If I change jpegData(compressionQuality: 1) this , I can reduce this size but If I change this , MyImage quality is also down. So I want to compress this byteArray to reduce size and send to server with no losing quality. I searched some questions and answers in SO but can't find anything.

So , How can I compress byte Array for Image with no losing quality of image?

Omer Tekbiyik
  • 4,255
  • 1
  • 15
  • 27
  • You can send it as HEIC instead of jpeg https://stackoverflow.com/questions/61830224/how-can-i-convert-from-uiimage-to-heif-heic-data-in-swift/61830766#61830766 – Leo Dabus Sep 10 '20 at 14:22

0 Answers0