Compressing HEIC/HEIF files

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Posts: 3
Joined: 2019-08-01T03:28:09-07:00
Authentication code: 1152

Compressing HEIC/HEIF files

Post by Le9 »


I am in need of a command to compress .heic/.heif files , which are a format supported by imagemagick, and .jpeg/.png files so I can get their PSNR of the original images/coded ones to afterwards make a curve with bits per pixel so I can get a quality curve. All I have found are command-lines to convert either JPEG with:

//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg

or to PNG with:

// This command compresses a png with no visible loss of quality
mogrify -filter Triangle -define filter:support=2 -unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 -define png:compression-filter=5 -define png:compression-level=9 -define png:compression-strategy=1 -define png:exclude-chunk=all -interlace none -colorspace sRGB *.png

Taken from ... 6eaf05c6e9

But have not found any for heif, I do not know if I just have my concepts messed up or something but I would kindly appreciate any help given. My goal is as I said before to get PSNR of same file in different formats and make a curve with its bits per pixels.
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Compressing HEIC/HEIF files

Post by snibgo »

Code: Select all

f:\web\im>%IMG7%magick -list format |grep HEIC

     HEIC* HEIC      r--   Apple High efficiency Image Format
The version of IM on my computer, v7.0.7-28, can read HEIC files but cannot write them.
snibgo's IM pages:
Post Reply