summaryrefslogtreecommitdiffstats
path: root/doc/usage/extensions/imgconverter.rst
blob: b9af22d6f331db5b18b0f5211dc1b0ce719ded1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.. _sphinx.ext.imgconverter:

:mod:`sphinx.ext.imgconverter` -- A reference image converter using Imagemagick
===============================================================================

.. module:: sphinx.ext.imgconverter
   :synopsis: Convert images to appropriate format for builders

.. versionadded:: 1.6

This extension converts images in your document to appropriate format for
builders.  For example, it allows you to use SVG images with LaTeX builder.
As a result, you don't mind what image format the builder supports.

By default the extension uses ImageMagick_ to perform conversions,
and will not work if ImageMagick is not installed.

.. _ImageMagick: https://www.imagemagick.org

.. note::

   ImageMagick rasterizes a SVG image on conversion.  As a result, the image
   becomes not scalable.  To avoid that, please use other image converters like
   `sphinxcontrib-svg2pdfconverter`__ (which uses Inkscape or
   ``rsvg-convert``).

.. __: https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter


Configuration
-------------

.. confval:: image_converter

   A path to a conversion command.  By default, the imgconverter finds
   the command from search paths.

   On Unix platforms, the command :command:`convert` is used by default.

   On Windows, the command :command:`magick` is used by default.

   .. versionchanged:: 3.1

      Use :command:`magick` command by default on windows

.. confval:: image_converter_args

   Additional command-line arguments to give to :command:`convert`, as a list.
   The default is an empty list ``[]``.

   On Windows, it defaults to ``["convert"]``.

   .. versionchanged:: 3.1

      Use ``["convert"]`` by default on Windows