Javatpoint Logo
Javatpoint Logo

Install ImageMagick Ubuntu

Introduction to ImageMagick

ImageMagick is an open-source and free cross-platform software suite to display, create, convert, modify, and edit raster images, prescribed from the command line as magick. It was developed by John Christy in 1987 and can write and read over 200 image file formats. ImageMagick and its components are extensively used in many open-source applications.

ImageMagick is used for creating, editing, composing, or converting digital images. It can write and read images in a range of formats (200+), including TIFF, EXR, DPX, PDF, SVG, HEIC, WebP, GIF, JPEG, and PNR. It can transform, shear, distort, rotate, mirror, flip, and resize images, adjust image colors, use several special effects, or draw Bezier curves, ellipses, polygons, lines, and text.

ImageMagick is a free software offered as a ready-to-run binary distro or a source code that we may use, distribute, modify, and copy in both proprietary and open applications. It is shared upon a derived Apache 2.0 license.

ImageMagick uses more than one computational thread to enhance performance. The latest release of ImageMagick is 7.1.0-43. It runs on Android OS, iOS, Mac OS X, Windows, Linux, and others.

History of ImageMagick

ImageMagick was developed by John Christy in 1987 when operating on DuPont, converting 24-bit images to 8-bit images, so they could be shown on almost all screens during the period. It was freely published in 1990 when DuPont admitted to sending copyright to ImageMagick Studio LLC, which is still the project maintainer organization currently.

It was announced that ImageMagick had a susceptibility from which an attacker can run arbitrary codes over servers that utilize the application for editing user-uploaded images in May 2016. Security experts adding CloudFlare researchers noted the actual use of the susceptibility in active hacking attacks. The security flaw was because ImageMagick called backend resources without properly checking to make sure the file names and paths were free of wrong shell commands. The susceptibility didn't affect the distributions of ImageMagick that added a correctly configured security policy.

Capabilities and Features of ImageMagick

Mainly, the software consists of many command-line interface utilities that manipulate images. ImageMagick doesn't have a strong graphical user interface for editing images as GIMP and Adobe Photoshop but does contain- for UNIX-like operating systems- a common native X Window GUI (known as IMDisplay) to render and manipulate API libraries and images for several programming languages.

The program applies magic numbers to recognize image file formats.

Several programs, such as vBulletin, phpBB, MediaWiki, and Drupal, can apply ImageMagick to make image thumbnails. Also, ImageMagick is used by many other programs, like LyX, to convert images.

ImageMagick contains a fully developed Perl binding known as PerlMagick, as well as various others: TclMagick (TK/Tcl), RMagick (Ruby), PythonMagick (Python), IMagick (PHP), MagickWand for PHP (PHP), PascalMagick (Pascal), MagickNet (.NET), NMagick (Neko/Haxe), L-Magick (Lisp), JMagick (Java), Magick++ (C++), ImageMagickObject (COM+), ChMagick (Ch), MagickWand (C), MagickCore (C), or G2F (Ada).

Install ImageMagick Ubuntu

File format transformation

One of the thoroughly-implemented and basic aspects of ImageMagick is its capability to accurately and efficiently transform images between distinct file formats (it applies the convert command to achieve it).

Color quantization

In an image, many colors can be decreased to an arbitrary number, and it is done by balancing the most outstanding color values available among the image pixels.

The related ability is the posterization artistic effect, which also decreases many colors illustrated in an image. The distinction between it and idea color quantization is that the final palette in the standard quantization is chosen based on a prominent weighting of available colors in the image; posterization makes the color palette smoothly distributed around the spectrum illustrated in the image.

Every final value is one that was in the real image with standard color quantization, the color values in the posterized image might not have been available in the real image but are in between the real color values.

Liquid rescaling

Liquid rescaling support was added in 2008. This feature permits, for instance, rescaling 4:3 images into 16:9 images without altering an image.

Dithering

Good control is given for the dithering that appears during sharing and color alterations, including the capability to produce halftone dithering.

Artistic effects

ImageMagick contains a range of features and filters intended to make artistic effects:

  • Posterization
  • Charcoal sketch transform

Deep color

The Q8 version supports up to 8 bits-per-pixel elements (8-bit grayscale, 24 or 32-bit RGB color). The Q16 version supports up to 16 bits-per-pixel elements (16-bit grayscale, 48 or 64-bit RGB colors).

OpenCL

ImageMagick can apply OpenCL to utilize an accelerated graphics card for processing.

Other

The following are a few other aspects of ImageMagick which are listed and explained below:

  • Transform: It trims, flips, crops, rotates, or resizes an image (uses these without generation loss over JPEG file format where possible).
  • Format conversion: It converts an image from a format to other (e.g., JPEG to PNG).
  • Transparency: It renders image portions invisible.
  • Decorate: It adds a frame or border to an image.
  • Draw: It adds text or shapes to an image.
  • Special effects: It tints, thresholds, sharpens, or blurs an image.
  • Animation: It assembles a file of GIF animation from an order of images.
  • Image identification: It describes the attributes and format of an image.
  • Comments and text: It inserts artistic and descriptive text in an image.
  • Composite: It overlaps an image over another.
  • Generalized pixel distortion: It corrects for or activates image distortions such as perspective.
  • Montage: It connects image thumbnails over the image canvas.
  • Shape morphology: It reads and writes the basic image formats utilized in digital film work:
  • Discrete Fourier transform: It implements inverse and forward DFT.
  • Image calculator: It uses a mathematical expression to the image channels or an image.
  • Color management: It applies correct color management along with color profiles or built-in gamma expansion or compression lieu as claimed by the colorspace.
  • Encipher or decipher an image: It converts basic images into illegible gibberish and back again.
  • High-dynamic-range images: It accurately illustrates the huge variety of intensity levels detected in actual scenes ranging from the direct sunlight to the darkest shadows.
  • Large image support: It reads, processes, or writes tera, giga, or mega-pixel image sizes.
  • Execution support thread: ImageMagick is thread safe, and almost all internal algorithms run in parallel to take benefit of speed-ups provided by multicore processor chips.
  • Virtual pixel support: It provides convenient access to the pixels external to the image region.
  • Distributed pixel cache: It offloads intermediate pixel storage to multiple remote servers.
  • Heterogeneous distributed processing: Many algorithms are OpenCL-enabled for taking benefit of speed-ups provided by running in concert around heterogeneous environments consisting of GPUs, CPUs, and other processors.
  • ImageMagick on the iPhone: It converts, edits, or composes images on the iOS computing machines such as the iPad or iPhone.

ImageMagick Related Software

ImageMagick 5.5.2 has a fork, i.e., GraphicsMagick. It was created in 2002, focusing on the cross-release programming API stability and command-line options. GraphicsMagick came up as an outcome of incompatible differences in the group of developers.

ImageMagick Distribution

It is cross-platform and executes on Unix-like and Microsoft Windows systems, including FreeBSD, Haiku, Solaris, Android, iOS, macOS, and Linux. The source code of the project can be compiled for several systems, including MorphOS and AmigaOS 4.0. It has been run upon IRIX.

Command-line Tools of ImageMagick

ImageMagick contains several command-line utilities to manipulate images. Most of us are probably addicted to editing images once at a time using a graphical user interface with such programs as Photoshop or GIMP. But GUI isn't always good.

Suppose we wish to dynamically process an image through a web script, or we wish to use similar operations to various images or repeat a particular operation at distinct times to the different or same image. The image processing utility of the command-line is correct for these operations.

The command-line tools of ImageMagick exit with the 0 status if the arguments of the command-line have an accurate syntax and no issues are encountered. Expect the 1 status and a descriptive message if any exception occurs, like improper syntax, an issue writing or reading an image, or other problems that avoid the command from successfully completing.

Here is a description of all command-line tools:

Install ImageMagick Ubuntu
  • magick: It converts between many image formats and image resize, blur, re-sample, join, flip, draw on, dither, despeckle, crop, and others.
  • magick-script: We can use the magick-script scripting language interpreter for converting between many image formats and image resize, blur, re-sample, join, flip, draw on, dither, despeckle, crop, and others.

Sub-commands are also supported with ImageMagick version 6 for compatibility:

  • magick animate: It animates an image sequence over a server.
  • magick composite: It overlaps an image over others.
  • magick compare: It visually and mathematically annotates the distinction between a picture and its reconstruction.
  • magick conjure: It interprets and runs scripts specified in MSL (Magick Scripting Language).
  • magick convert: It converts between several image formats an image resize, blur, re-sample, despeckle, crop, draw on, dither, join, flip, and much more.
  • magick identify: It defines the characteristics or formats of multiple image files.
  • magick display: It shows an image sequence or image on a server.
  • magick import: It saves a clear window on the X server and results it as an image file. We can capture one window, a rectangular part of the screen, or the whole screen.
  • magick montage: It creates a composite image by associating many isolated images. The images are positioned on the composite image and decorated optionally with an image name, frame, border, and more.
  • magick mogrify: Image resize, blur, re-sample, despeckle, crop, draw on, dither, join, flip, and much more. It overwrites the actual image file, but magick writes on a distinct image file.
  • magick stream: It is a lightweight tool for streaming multiple pixel elements of an image or part of an image to our desired storage formats. It can write the pixel elements as they're read through the input image one row at once, making the stream fascinating if functioning with large images or if we need raw pixel elements.

Development of ImageMagick

Typically, the ImageMagick functionality is used from the command-line, or we can use the aspects from programs specified in our favorite language. We can select from several interfaces. We can also use ImageMagick to create or modify images automagically and dynamically with the language interfaces.

We can select from many language interfaces:

  • C: We can use the thread-safe library, i.e., MagickWand to edit, compose, and convert images with the C language. Also,.there is a low-level thread-safe library, i.e., MagickCore for wizard-level developers. A development library is also available, called MagickCacheAPI, to use an efficient image cache.
  • C++: Magick++ offers an object-oriented thread-safe C++ interface for ImageMagick.
  • Ch: It is a Ch binding to the MagickWand and MagickCore API. It is a C/C++ interpreter for scripting.
  • GO: GoImagick is a collection of Go bindings to the MagickCore and MagickWand APIs of ImageMagick.
  • Java: JMagick offers an object-oriented interface of Java to ImageMagick. There is also a pure-java interface, which is called Im4java, to the ImageMagick command-line.
  • TypeScript/JavaScript: WASM-ImageMagick is a Webassembly ImageMagick compilation that permits client-side serverless bindings for JavaScript and TypeScript. It operates in Progressive Web Apps.
  • KMagick: It offers Kotlin bindings for ImageMagick.
  • Julia: JuliaIO offers an object-oriented interface of Julia to ImageMagick.
  • Lisp: CL-Magick offers a Common interface of Lisp to ImageMagick.
  • LabVIEW: LVOOP ImageMagick is an object-oriented interface of LabVIEW to ImageMagick.
  • Lua: It provides Lua bindings for LuaJIT with FFI to ImageMagick.
  • Neko: NMagick is an ImageMagick library port to the Neko and haXe It offers the capabilities of image manipulation to both desktop and web applications with Neko.
  • .NET: ImageMagick is an application of .NET written in C# that uses the ImageMagick command-line to permit the conversion of more than one image format to distinct formats. We can use Magick.NET to edit, compose, and convert images from Windows.NET.

Installing ImageMagick in Ubuntu

ImageMagick is a very famous open-source software suite used for editing bitmap images. In this article, we will discuss how we can install the latest release of ImageMagick in Ubuntu.

Installing ImageMagick with the APT Package Repository

We can install the current stable release of ImageMagick from the APT package repository of the official Ubuntu.

First, we need to update the APT cache repository of our system by running the below command:

After updating the package repository of our system, we can install ImageMagick with the help of the below command:


Install ImageMagick Ubuntu

Type the "y" button and press the "Enter" button to grant extra disk space and proceed with the installation process.

We need to verify the installation by entering the below command once ImageMagick is successfully installed in our system.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA