I'm working with images selected from the iOS Photos app using PHPickerViewController.
Some images appear as HEIF in the Photos info panel — which I understand are stored in the HEIC format, i.e., HEIF containers with HEVC-compressed images, commonly used on iOS when "High Efficiency" is enabled.
To convert these images to JPEG, I'm using the standard UIKit approach:
if let image = UIImage(data: heicData) {
let jpegData = image.jpegData(compressionQuality: 1.0)
}
However, I’ve noticed that this conversion often increases the image size significantly:
Original HEIC/HEIF: ~3 MB
Converted JPEG (quality: 1.0): ~8–12 MB
There’s no resolution change or image editing — it’s just a direct conversion. I understand that HEIC is more efficient than JPEG, but the increase in file size feels disproportionate. Is this kind of jump expected, or are there any recommended workarounds to avoid it?
Two reasons:
- Your asking for lossless quality, which forces the encoder to produce less efficient compression.
- Since your starting from a compressed image, your also encoding compression artifacts from that image. In general this is worst case – decoding one formats compression artifacts and trying to encode them into another format usually defeats the other formats compression techniques in some way.
I suspect if you use a lower compressionQuality (such as 0.8) you'll get much more reasonable file sizes.