OS Manuals

/usr/bin/heif-enc

libheif is an HEIF and AVIF file format decoder and encoder.

From libheif 1.23.7-r1 (os), captured 2026-11-05 by running heif-enc --help (exit 0). permalink

 heif-enc  libheif version: 1.23.7
-----------------------------------
Usage: heif-enc [options] <input-image> ...

When specifying multiple source images, they will all be saved into the same HEIF/AVIF file.

Some encoders (x265, aom) let you pass-through any parameters by prefixing them with the encoder name.
For example, you may pass any x265 parameter by prefixing it with 'x265:'. For example, to set
the 'ctu' parameter, you will have to set 'x265:ctu' in libheif (e.g.: -p x265:ctu=64).
Note that when using the prefix, libheif cannot tell you which parameters and values are supported.

Options:
  -h, --help                     show help
  -v, --version                  show version
  -o, --output                   output filename (optional)
  -q, --quality                  set output quality (0-100) for lossy compression
  -L, --lossless                 generate lossless output (-q has no effect). Image will be encoded as RGB (matrix_coefficients=0).
  -t, --thumb #                  generate thumbnail with maximum size # (default: off)
      --no-alpha                 do not save alpha channel
      --no-thumb-alpha           do not save alpha channel in thumbnail image
      --verbose                  enable logging output (more will increase logging level)
  -b, --bit-depth #              number of bits to use from an 16-bit PNG input, valid range: 9-16 (default: 10 bit)
      --premultiplied-alpha      input image has premultiplied alpha
  -C, --chroma-downsampling ALGO    force chroma downsampling algorithm (nn = nearest-neighbor / average / sharp-yuv)
                                    (sharp-yuv makes edges look sharper when using YUV420 with bilinear chroma upsampling)
      --benchmark                   measure encoding time, PSNR, and output file size
      --pitm-description TEXT       set user description for primary image (experimental)
      --add-compatible-brand BRAND  add a compatible brand to the output file (4 characters)
      --unif                        use unified ID namespace (adds 'unif' compatible brand)
      --mini                        use compact 'mini' box format

codecs:
  -A, --avif                     encode as AVIF (not needed if output filename with .avif suffix is provided)
      --hevc                     encode as HEVC (default)
      --vvc                      encode as VVC (experimental)
      --avc                      encode as AVC (experimental)
      --jpeg                     encode as JPEG
      --jpeg2000                 encode as JPEG 2000 (experimental)
      --htj2k                    encode as High Throughput JPEG 2000 (experimental)
  -U, --uncompressed             encode as uncompressed image (according to ISO 23001-17)
      --unci-compression METHOD  choose one of these methods: none, deflate, zlib, brotli.
      --list-encoders            list all available encoders for all compression formats
  -e, --encoder ID               select encoder to use (the IDs can be listed with --list-encoders)
      --plugin-directory DIR     load all codec plugins in the directory
  -P, --params                   show all encoder parameters and exit, input file not required or used.
  -p NAME=VALUE                  set encoder parameter

raw input:
      --raw                      force raw pixel data input (for files without .raw/.img suffix)
      --raw-width #              width of raw input image (computed from file size if omitted)
      --raw-height #             height of raw input image (computed from file size if omitted)
      --raw-type TYPE            pixel data type: uint8, sint8, uint16, sint16, uint32, sint32, float32, float64
      --raw-endian ENDIAN        byte order of input data: little (default), big

color profile:
      --color-profile NAME       use a color profile preset for the output. Valid values are:
                                    custom:     (default) use the provided matrix_coefficients, colour_primaries, transfer_characteristic
                                    auto:       automatically guess suitable values from the input image characteristics
                                    compatible: use a profile that is decoded correctly by most applications by avoiding incomplete implementations
                                    601:        use Rec.601 (SD), close to JPEG
                                    709:        use Rec.709 (HDTV), close to sRGB
                                    2020:       use Rec.2020 (UHDTV), transfer curve will be selected based on bits per pixel
      --matrix_coefficients     nclx profile: color conversion matrix coefficients, default=6 (see h.273)
      --colour_primaries        nclx profile: color primaries (see h.273)
      --transfer_characteristic nclx profile: transfer characteristics (see h.273)
      --full_range_flag         nclx profile: full range flag, default: 1
      --enable-two-colr-boxes   will write both an ICC and an nclx color profile if both are present
      --clli MaxCLL,MaxPALL     add 'content light level information' property to all encoded images
      --pasp h,v                set pixel aspect ratio property to all encoded images
      --rotate-cw #             rotate input image by 0, 90, 180, 270 degrees (clock-wise)
      --flip-h / --flip-v       flip input image horizontally or vertically

tiling:
      --cut-tiles #             cuts the input image into square tiles of the given width
  -T, --tiled-input             input is a set of tile images (only provide one filename with two tile position numbers).
                                For example, 'tile-01-05.jpg' would be a valid input filename.
                                You only have to provide the filename of one tile as input, heif-enc will scan the directory
                                for the other tiles and determine the range of tiles automatically.
      --tiled-image-width #     override image width of tiled image
      --tiled-image-height #    override image height of tiled image
      --tiled-input-x-y         usually, the first number in the input tile filename should be the y position.
                                With this option, this can be swapped so that the first number is x, the second number y.
      --tiling-method METHOD    choose one of these methods: grid, unci. The default is 'grid'.

sequences:
  -S, --sequence                 encode input images as sequence (input filenames with a number will pull in all files with this pattern).
  -V, --video                    encode as video instead of image sequence
      --timebase #               set clock ticks/second for sequence
      --duration #               set frame duration (default: 1)
      --fps #                    set timebase and duration based on fps
      --repetitions #            set how often the sequence should be played back (default=1), special value: 'infinite'
      --gop-structure GOP        frame types to use in GOP (intra-only, low-delay, unrestricted)
      --min-keyframe-distance #  minimum distance of keyframes in sequence (0 = undefined)
      --max-keyframe-distance #  maximum distance of keyframes in sequence (0 = undefined)
      --max-frames #             limit sequence length to maximum number of frames
omnidirectional imagery:
      --omaf-image-projection PROJ    set the image projection (equirectangular, cube-map)
Options (62)
OptionDescriptionSource
-h, --helpshow helphelp
-v, --versionshow versionhelp
-o, --outputoutput filename (optional)help
-q, --qualityset output quality (0-100) for lossy compressionhelp
-L, --losslessgenerate lossless output (-q has no effect).help + man
-t, --thumb #generate thumbnail with maximum size # (default: off)help
--no-alphaDo not save alpha channel.help + man
--no-thumb-alphaDo not save alpha channel in thumbnail image.help + man
--verboseEnable logging output (more will increase logging level).help + man
-b, --bit-depth #number of bits to use from an 16-bit PNG input, valid range: 9-16 (default: 10 bit)help
--premultiplied-alphainput image has premultiplied alphahelp
-C, --chroma-downsampling ALGOforce chroma downsampling algorithm (nn = nearest-neighbor / average / sharp-yuv) (sharp-yuv makes edges look sharper when using YUV420 with bilinear chroma upsampling)help
--benchmarkmeasure encoding time, PSNR, and output file sizehelp
--pitm-description TEXTset user description for primary image (experimental)help
--add-compatible-brand BRANDadd a compatible brand to the output file (4 characters)help
--unifuse unified ID namespace (adds 'unif' compatible brand)help
--miniuse compact 'mini' box formathelp
-A, --avifencode as AVIF (not needed if output filename with .avif suffix is provided)help
--hevcencode as HEVC (default)help
--vvcencode as VVC (experimental)help
--avcencode as AVC (experimental)help
--jpegencode as JPEGhelp
--jpeg2000encode as JPEG 2000 (experimental)help
--htj2kencode as High Throughput JPEG 2000 (experimental)help
-U, --uncompressedencode as uncompressed image (according to ISO 23001-17)help
--unci-compression METHODchoose one of these methods: none, deflate, zlib, brotli.help
--list-encoderslist all available encoders for all compression formatshelp
-e, --encoder IDselect encoder to use (the IDs can be listed with --list-encoders)help
--plugin-directory DIRload all codec plugins in the directoryhelp
-P, --paramsshow all encoder parameters and exit, input file not required or used.help + man
-p NAME=VALUEset encoder parameterhelp
--rawforce raw pixel data input (for files without .raw/.img suffix)help
--raw-width #width of raw input image (computed from file size if omitted)help
--raw-height #height of raw input image (computed from file size if omitted)help
--raw-type TYPEpixel data type: uint8, sint8, uint16, sint16, uint32, sint32, float32, float64help
--raw-endian ENDIANbyte order of input data: little (default), bighelp
--color-profile NAMEuse a color profile preset for the output.help
--matrix_coefficientsnclx profile: color conversion matrix coefficients, default=6 (see h.273)help
--colour_primariesnclx profile: color primaries (see h.273)help
--full_range_flagnclx profile: full range flag, default: 1help
--enable-two-colr-boxeswill write both an ICC and an nclx color profile if both are presenthelp
--clli MaxCLLadd 'content light level information' property to all encoded imageshelp
--pasp hset pixel aspect ratio property to all encoded imageshelp
--rotate-cw #rotate input image by 0, 90, 180, 270 degrees (clock-wise)help
--flip-h /flip input image horizontally or verticallyhelp
--cut-tiles #cuts the input image into square tiles of the given widthhelp
-T, --tiled-inputinput is a set of tile images (only provide one filename with two tile position numbers).help
--tiled-image-width #override image width of tiled imagehelp
--tiled-image-height #override image height of tiled imagehelp
--tiled-input-x-yusually, the first number in the input tile filename should be the y position.help
--tiling-method METHODchoose one of these methods: grid, unci.help
-S, --sequenceencode input images as sequence (input filenames with a number will pull in all files with this pattern).help
-V, --videoencode as video instead of image sequencehelp
--timebase #set clock ticks/second for sequencehelp
--duration #set frame duration (default: 1)help
--fps #set timebase and duration based on fpshelp
--repetitions #set how often the sequence should be played back (default=1), special value: 'infinite'help
--gop-structure GOPframe types to use in GOP (intra-only, low-delay, unrestricted)help
--min-keyframe-distance #minimum distance of keyframes in sequence (0 = undefined)help
--max-keyframe-distance #maximum distance of keyframes in sequence (0 = undefined)help
--max-frames #limit sequence length to maximum number of frameshelp
--omaf-image-projection PROJset the image projection (equirectangular, cube-map)help
Exit status (2) from the manual page
0Success
1Failure (syntax or usage error;

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.