Does OpenCV support .HEIC image format?

7.3k Views Asked by At

I'm working on a face detection project and want to know if opencv provides support for heic format in imread() and imwrite() methods? Can an image be read using cv2's imread() and written using cv2.imwrite() functions? (Language being used: Python3.6)

2

There are 2 best solutions below

0
On

cv2's imread() currently, the following file formats are supported:

  • Windows bitmaps - *.bmp, *.dib (always supported)
  • JPEG files - *.jpeg, *.jpg, *.jpe (see the Note section)
  • JPEG 2000 files - *.jp2 (see the Note section)
  • Portable Network Graphics - *.png (see the Note section)
  • WebP - *.webp (see the Note section)
  • Portable image format - *.pbm, *.pgm, *.ppm *.pxm, *.pnm (always supported)
  • Sun rasters - *.sr, *.ras (always supported)
  • TIFF files - *.tiff, *.tif (see the Note section)
  • OpenEXR Image files - *.exr (see the Note section)
  • Radiance HDR - *.hdr, *.pic (always supported)
  • Raster and Vector geospatial data supported by GDAL (see the Note section)

doc link

0
On

According to the API docs of the latest available OpenCV (5.0-pre), HEIC is still not supported.

Update: As mentioned above, there's a feature request from May'19 in the OpenCV repo, which still has an "Open" status and unfortunately has a "Low" priority.