<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE delegatemap [
  <!ELEMENT delegatemap (delegate)+>
  <!ATTLIST delegatemap xmlns CDATA #FIXED ''>
  <!ELEMENT delegate EMPTY>
  <!ATTLIST delegate xmlns CDATA #FIXED '' command CDATA #REQUIRED
    decode NMTOKEN #IMPLIED encode NMTOKEN #IMPLIED mode NMTOKEN #IMPLIED
    spawn NMTOKEN #IMPLIED stealth NMTOKEN #IMPLIED>
]>
<!--
  Delegate command file.

  Commands which specify

    decode="in_format" encode="out_format"

  specify the rules for converting from in_format to out_format.  Use these
  rules to translate directly between formats.

  Commands which specify only

    decode="in_format"

  specify the rules for converting from in_format to some format that
  ImageMagick automatically recognizes. Use these rules to decode formats.

  Commands which specify only

   encode="out_format"

  specify the rules for an "encoder" which may accept any input format.

  The substitution rules are as follows:

    %a  authentication passphrase
    %b  image file size in bytes
    %g  image geometry
    %h  image rows (height)
    %i  input image filename
    %#  input image signature
    %m  input image format
    %o  output image filename
    %p  page number
    %q  input image depth
    %s  scene number
    %u  unique temporary filename
    %w  image columns (width)
    %x  input image x resolution
    %y  input image y resolution
    %Q  input image compression quality

  Set option delegate:bimodal=true to process bimodal delegates otherwise they
  are ignored.

  If stealth="True" the delegate is not listed in user requested
  "-list delegate" listings. These are typically special internal delegates.

  If spawn="True", ImageMagick does not wait for the delegate to finish, nor
  will it read any output image.
-->
<delegatemap>
  <delegate decode="bpg" command="&apos;bpgdec&apos; -b 16 -o &apos;%o&apos; &apos;%i&apos;"/>
  <delegate decode="png" encode="bpg" command="&apos;bpgenc&apos; -b 12 -q &apos;%~&apos; -o &apos;%o&apos; &apos;%i&apos;"/>
  <delegate decode="blender" command="&apos;blender&apos; -b &apos;%i&apos; -F PNG -o &apos;%o&apos;&apos;\n&apos;magick&apos; -concatenate &apos;%o*.png&apos; &apos;%o&apos;"/>
  <delegate decode="browse" stealth="True" spawn="True" command="&apos;xdg-open&apos; https://imagemagick.org/; /usr/bin/rm &apos;%i&apos;"/>
  <delegate decode="http:decode" command="&apos;curl&apos; -s -L -o &apos;%u.dat&apos; &apos;http:%M&apos;"/>
  <delegate decode="https:decode" command="&apos;curl&apos; -s -L -o &apos;%u.dat&apos; &apos;https:%M&apos;"/>
  <delegate decode="doc" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="docx" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="dng:decode" command="/usr/bin/mkdir &apos;%u-config&apos;;/usr/bin/mv &apos;%i&apos; &apos;%i.%e&apos;; &apos;darktable-cli&apos; --import &apos;%i.%e&apos; &apos;%u.tif&apos; --core --configdir &apos;%u-config&apos; &gt; &apos;%u&apos;;/usr/bin/rm -r &apos;%u-config&apos;"/>
  <delegate decode="dot" command="&apos;dot&apos; -Tsvg &apos;%i&apos; -o &apos;%o&apos;" />
  <delegate decode="dvi" command="&apos;dvips&apos; -sstdout=%%stderr -o &apos;%o&apos; &apos;%i&apos;"/>
  <delegate decode="edit" stealth="True" command="&apos;xterm&apos; -title &apos;Edit Image Comment&apos; -e vi &apos;%o&apos;"/>
  <delegate decode="emf" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="eps" encode="pdf" mode="bi" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 &apos;-sDEVICE=pdfwrite&apos; &apos;-sOutputFile=%o&apos; &apos;-f%i&apos;"/>
  <delegate decode="eps" encode="ps" mode="bi" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=ps2write&apos; &apos;-sOutputFile=%o&apos; &apos;-f%i&apos;"/>
  <delegate decode="epub" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="hpg" command="&apos;hp2xx&apos; -sstdout=%%stderr -m eps -f `basename &apos;%o&apos;` &apos;%i&apos;;     /usr/bin/mv -f `basename &apos;%o&apos;` &apos;%o&apos;"/>
  <delegate decode="hpgl" command="&apos;hp2xx&apos; -sstdout=%%stderr -m eps -f `basename &apos;%o&apos;` &apos;%i&apos;;     /usr/bin/mv -f `basename &apos;%o&apos;` &apos;%o&apos;"/>
  <delegate decode="htm" command="&apos;html2ps&apos; -U -o &apos;%o&apos; &apos;%i&apos;"/>
  <delegate decode="html" command="&apos;html2ps&apos; -U -o &apos;%o&apos; &apos;%i&apos;"/>
  <delegate decode="ilbm" command="&apos;ilbmtoppm&apos; &apos;%i&apos; &gt; &apos;%o&apos;"/>
  <delegate decode="jpg" encode="lep" mode="encode" command="&apos;lepton&apos; &apos;%i&apos; &apos;%o&apos;"/>
  <delegate decode="jxr" command="/usr/bin/mv &apos;%i&apos; &apos;%i.jxr&apos;; &apos;JxrDecApp&apos; -i &apos;%i.jxr&apos; -o &apos;%o.tiff&apos;; /usr/bin/mv &apos;%i.jxr&apos; &apos;%i&apos;; /usr/bin/mv &apos;%o.tiff&apos; &apos;%o&apos;"/>
  <delegate decode="lep" mode="decode" command="&apos;lepton&apos; &apos;%i&apos; &apos;%o&apos;"/>
  <delegate decode="miff" encode="show" spawn="True" command="&apos;magick&apos; display -immutable -delay 0 -title &apos;%M&apos; &apos;%i&apos;"/>
  <delegate decode="miff" encode="win" stealth="True" spawn="True" command="&apos;magick&apos; display -immutable -delay 0 -title &apos;%M&apos; &apos;%i&apos;"/>
  <delegate decode="odg" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="odt" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="pcl:cmyk" stealth="True" command="&apos;pcl6&apos; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=pamcmyk32&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;%s&apos;"/>
  <delegate decode="pcl:color" stealth="True" command="&apos;pcl6&apos; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=png16malpha&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;%s&apos;"/>
  <delegate decode="pcl:mono" stealth="True" command="&apos;pcl6&apos; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=pbmraw&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;%s&apos;"/>
  <delegate decode="pdf" encode="eps" mode="bi" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=eps2write&apos; &apos;-sPDFPassword=%a&apos; &apos;-sOutputFile=%o&apos; &apos;-f%i&apos;"/>
  <delegate decode="pdf" encode="ps" mode="bi" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=ps2write&apos; &apos;-sPDFPassword=%a&apos; &apos;-sOutputFile=%o&apos; &apos;-f%i&apos;"/>
  <delegate decode="pnm" encode="trace" command="&apos;potrace&apos; --svg --output &apos;%o&apos; &apos;%i&apos;"/>
  <delegate decode="png" encode="clipboard" command="&apos;xclip&apos; -selection clipboard -t image/png &apos;%i&apos;"/>
  <delegate decode="clipboard" command="&apos;xclip&apos; -selection clipboard -o &gt; &apos;%o&apos;"/>
  <delegate decode="png" encode="webp" command="&apos;cwebp&apos; -quiet -q %Q &apos;%i&apos; -o &apos;%o&apos;"/>
  <delegate decode="pnm" encode="ilbm" mode="encode" command="&apos;ppmtoilbm&apos; -24if &apos;%i&apos; &gt; &apos;%o&apos;"/>
  <delegate decode="tiff" encode="jxr" command="/usr/bin/mv &apos;%i&apos; &apos;%i.tiff&apos;; &apos;JxrEncApp&apos; -i &apos;%i.tiff&apos; -o &apos;%o.jxr&apos; -q %Q; /usr/bin/mv &apos;%i.tiff&apos; &apos;%i&apos;; /usr/bin/mv &apos;%o.jxr&apos; &apos;%o&apos;"/>
  <delegate decode="tiff" encode="wdp" command="/usr/bin/mv &apos;%i&apos; &apos;%i.tiff&apos;; &apos;JxrEncApp&apos; -i &apos;%i.tiff&apos; -o &apos;%o.jxr&apos; -q %Q; /usr/bin/mv &apos;%i.tiff&apos; &apos;%i&apos;; /usr/bin/mv &apos;%o.jxr&apos; &apos;%o&apos;"/>
  <delegate decode="ppt" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="pptx" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="ps" encode="prt" command="&apos;lpr&apos; &apos;%i&apos;"/>
  <delegate decode="ps:alpha" stealth="True" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=png16malpha&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;-f%s&apos; &apos;-f%s&apos;"/>
  <delegate decode="ps:cmyk" stealth="True" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=pamcmyk32&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;-f%s&apos; &apos;-f%s&apos;"/>
  <delegate decode="ps:color" stealth="True" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=png16m&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;-f%s&apos; &apos;-f%s&apos;"/>
  <delegate decode="ps" encode="eps" mode="bi" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=eps2write&apos; &apos;-sOutputFile=%o&apos; &apos;-f%i&apos;"/>
  <delegate decode="ps" encode="pdf" mode="bi" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=pdfwrite&apos; &apos;-sOutputFile=%o&apos; &apos;-f%i&apos;"/>
  <delegate decode="ps" encode="print" mode="encode" command="@LPRDelegateDefault@ &apos;%i&apos;"/>
  <delegate decode="ps:mono" stealth="True" command="&apos;gswin32c&apos; -sstdout=%%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=pbmraw&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;-f%s&apos; &apos;-f%s&apos;"/>
  <delegate decode="shtml" command="&apos;html2ps&apos; -U -o &apos;%o&apos; &apos;%i&apos;"/>
  <delegate decode="sid" command="&apos;mrsidgeodecode&apos; -if sid -i &apos;%i&apos; -of tif -o &apos;%o&apos; &gt; &apos;%u&apos;"/>
  <delegate decode="svg" command="&apos;rsvg-convert&apos; --dpi-x %x --dpi-y %y -o &apos;%o&apos; &apos;%i&apos;"/>
  <!-- Change export-filename to export-png for inkscape < 1.0 -->
  <delegate decode="svg:decode" stealth="True" command="&apos;inkscape&apos; &apos;%s&apos; &apos;--export-filename=%s&apos; &apos;--export-dpi=%s&apos; &apos;--export-background=%s&apos; &apos;--export-background-opacity=%s&apos;"/>
  <delegate decode="tiff" encode="text" command="&apos;tesseract&apos; &apos;%i&apos; &apos;%u&apos;; /usr/bin/mv &apos;%u.txt&apos; &apos;%o&apos;"/>
  <delegate decode="tiff" encode="launch" mode="encode" command="&apos;gimp&apos; &apos;%i&apos;"/>
  <delegate decode="wdp" command="/usr/bin/mv &apos;%i&apos; &apos;%i.jxr&apos;; &apos;JxrDecApp&apos; -i &apos;%i.jxr&apos; -o &apos;%o.tiff&apos;; /usr/bin/mv &apos;%i.jxr&apos; &apos;%i&apos;; /usr/bin/mv &apos;%o.tiff&apos; &apos;%o&apos;"/>
  <delegate decode="webp" command="&apos;dwebp&apos; -pam &apos;%i&apos; -o &apos;%o&apos;"/>
  <delegate decode="wmf" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="xls" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="xlsx" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="xps:cmyk" stealth="True" command="&apos;gxps&apos; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=pamcmyk32&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;%s&apos;"/>
  <delegate decode="xps:color" stealth="True" command="&apos;gxps&apos; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=png16malpha&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;%s&apos;"/>
  <delegate decode="xps:mono" stealth="True" command="&apos;gxps&apos; -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 &apos;-sDEVICE=pbmraw&apos; -dTextAlphaBits=%u -dGraphicsAlphaBits=%u &apos;-r%s&apos; %s &apos;-sOutputFile=%s&apos; &apos;%s&apos;"/>
  <delegate decode="video:decode" command="&apos;ffmpeg&apos; -nostdin -loglevel error -i &apos;%s&apos; -an -f rawvideo -y %s &apos;%s&apos;"/>
  <delegate encode="video:encode" stealth="True" command="&apos;ffmpeg&apos; -nostdin -loglevel error -i &apos;%s%%d.%s&apos; %s &apos;%s.%s&apos;"/>
  <delegate decode="vsd" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
  <delegate decode="vsdx" command="&apos;libreoffice&apos; --convert-to pdf --outdir `dirname &apos;%i&apos;` &apos;%i&apos; 2&gt; &apos;%u&apos;; /usr/bin/mv &apos;%i.pdf&apos; &apos;%o&apos;"/>
</delegatemap>
