HEIC is a HEIF container, and JPEG is a different compression
A .heic file is usually a HEIF container whose stills are coded with HEVC. JPEG stores the same scene as 8×8 DCT blocks and quantization tables. Turning one into the other decodes the HEVC picture and encodes a new JPEG. It does not rename the extension. Shrink that JPEG further in the image compressor, or turn the bytes into text with image to Base64.
The number on the quality control scales those quantization tables. A higher number keeps more fine detail and usually makes a larger file. It does not select a lossless JPEG.
What the two formats actually store
Why a HEIC file is a container and not a JPEG with a new name
- HEIF is the container, ISO/IEC 23008-12. HEIC is the usual name when the pictures inside are HEVC.
- The file is an ISO BMFF box structure. An ftyp box carries a brand such as heic, heix, or mif1.
- JPEG starts with the bytes FF D8. A HEIC file does not.
- Changing .heic to .jpg leaves the ftyp box in place, so a JPEG reader still rejects it.
How the quality number changes the JPEG, not the original HEVC
- HEVC and JPEG do not share a bitstream. The still has to be decoded, then encoded again.
- The quality value scales JPEG quantization. Coarser steps drop more high-frequency detail.
- 100 on this scale is still a lossy JPEG. The common quality control does not select JPEG lossless.
- The original HEVC data is not stored inside the new file, so a later decode cannot rebuild it.
Why one HEIF file can hold more than one picture
- The container can store a primary item, a grid, a burst, or an image sequence.
- Each coded image is its own picture once it is decoded.
- An Apple Live Photo is often a HEIC still plus a separate movie, not a second JPEG inside the same file.
- Baseline JPEG has no alpha channel. An auxiliary alpha image in the HEIF does not survive as transparency.
Why the JPEG and the HEIC are rarely the same size
- HEVC stills often use fewer bytes than JPEG for a similar picture. The ratio is not fixed.
- The new file’s size follows the quality setting and the picture, not the HEIC size.
- A quality near 90 aims at a visually close JPEG. It does not copy the HEVC byte count.
- iOS 11 made HEIF the camera default so a roll of photos would take less space than JPEG.
Where a JPEG reader meets a HEIF file
A program that only recognizes the JPEG start marker
It looks for FF D8. An ftyp brand of heic never matches, even when the scene is the same photograph. The program needs a newly encoded JPEG, not a renamed container.
A form whose accept list is JPEG and not HEIF
The form is checking the container and the media type. A HEIC brand fails that check. A JPEG produced from the decoded still passes it. Further shrinking belongs in the image compressor.