summaryrefslogtreecommitdiff
path: root/devdocs/elisp/imagemagick-images.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/imagemagick-images.html')
-rw-r--r--devdocs/elisp/imagemagick-images.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/devdocs/elisp/imagemagick-images.html b/devdocs/elisp/imagemagick-images.html
new file mode 100644
index 00000000..d4d86521
--- /dev/null
+++ b/devdocs/elisp/imagemagick-images.html
@@ -0,0 +1,21 @@
+ <h4 class="subsection">ImageMagick Images</h4> <p>If your Emacs build has ImageMagick support, you can use the ImageMagick library to load many image formats (see <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Conveniences.html#File-Conveniences">File Conveniences</a> in <cite>The GNU Emacs Manual</cite>). The image type symbol for images loaded via ImageMagick is <code>imagemagick</code>, regardless of the actual underlying image format. </p> <p>To check for ImageMagick support, use the following: </p> <div class="lisp"> <pre class="lisp">(image-type-available-p 'imagemagick)
+</pre>
+</div> <dl> <dt id="imagemagick-types">Function: <strong>imagemagick-types</strong>
+</dt> <dd><p>This function returns a list of image file extensions supported by the current ImageMagick installation. Each list element is a symbol representing an internal ImageMagick name for an image type, such as <code>BMP</code> for <samp>.bmp</samp> images. </p></dd>
+</dl> <dl> <dt id="imagemagick-enabled-types">User Option: <strong>imagemagick-enabled-types</strong>
+</dt> <dd><p>The value of this variable is a list of ImageMagick image types which Emacs may attempt to render using ImageMagick. Each list element should be one of the symbols in the list returned by <code>imagemagick-types</code>, or an equivalent string. Alternatively, a value of <code>t</code> enables ImageMagick for all possible image types. Regardless of the value of this variable, <code>imagemagick-types-inhibit</code> (see below) takes precedence. </p></dd>
+</dl> <dl> <dt id="imagemagick-types-inhibit">User Option: <strong>imagemagick-types-inhibit</strong>
+</dt> <dd><p>The value of this variable lists the ImageMagick image types which should never be rendered using ImageMagick, regardless of the value of <code>imagemagick-enabled-types</code>. A value of <code>t</code> disables ImageMagick entirely. </p></dd>
+</dl> <dl> <dt id="image-format-suffixes">Variable: <strong>image-format-suffixes</strong>
+</dt> <dd><p>This variable is an alist mapping image types to file name extensions. Emacs uses this in conjunction with the <code>:format</code> image property (see below) to give a hint to the ImageMagick library as to the type of an image. Each element has the form <code>(<var>type</var>
+<var>extension</var>)</code>, where <var>type</var> is a symbol specifying an image content-type, and <var>extension</var> is a string that specifies the associated file name extension. </p></dd>
+</dl> <p>Images loaded with ImageMagick support the following additional image descriptor properties: </p> <dl compact> <dt><code>:background <var>background</var></code></dt> <dd>
+<p><var>background</var>, if non-<code>nil</code>, should be a string specifying a color, which is used as the image’s background color if the image supports transparency. If the value is <code>nil</code>, it defaults to the frame’s background color. </p> </dd> <dt><code>:format <var>type</var></code></dt> <dd>
+<p>The value, <var>type</var>, should be a symbol specifying the type of the image data, as found in <code>image-format-suffixes</code>. This is used when the image does not have an associated file name, to provide a hint to ImageMagick to help it detect the image type. </p> </dd> <dt><code>:crop <var>geometry</var></code></dt> <dd>
+<p>The value of <var>geometry</var> should be a list of the form <code>(<var>width</var> <var>height</var> <var>x</var> <var>y</var>)</code>. <var>width</var> and <var>height</var> specify the width and height of the cropped image. If <var>x</var> is a positive number it specifies the offset of the cropped area from the left of the original image, and if negative the offset from the right. If <var>y</var> is a positive number it specifies the offset from the top of the original image, and if negative from the bottom. If <var>x</var> or <var>y</var> are <code>nil</code> or unspecified the crop area will be centered on the original image. </p> <p>If the crop area is outside or overlaps the edge of the image it will be reduced to exclude any areas outside of the image. This means it is not possible to use <code>:crop</code> to increase the size of the image by entering large <var>width</var> or <var>height</var> values. </p> <p>Cropping is performed after scaling but before rotation. </p>
+</dd> </dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/ImageMagick-Images.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/ImageMagick-Images.html</a>
+ </p>
+</div>