- Unix Commands Reference
- Unix Commands - Home
conjure Command in Linux
Conjure is a command line utility in Linux that belongs to the ImageMagick suite of tools. This command is used in Linux to interpret and run the scripts written in the Magick Scripting language (MSL).
MSL is primarily designed for users who want to perform custom image processing tasks without the need for programming.
Table of Contents
Here, we’ll discuss the installation process for the conjure command and its usage in Linux.
- How to Install conjure Command?
- How to Use conjure Command in Linux?
- How does the conjure Command Work?
How to Install conjure Command?
The conjure command is not pre-installed in modern Linux distributions. Therefore, you must install it manually using a suitable packager manager like apt, dnf, yum, or Paceman.
Installing conjure Command in Ubuntu
In Debian-based systems, we can install the conjure command from the ImageMagick suite of tools using the following command −
sudo apt install imagemagick -y
Let’s confirm the conjure command installation in the Ubuntu using the following command −
conjure -version
Installing conjure Command in Arch Linux
To install this command on Arch Linux, we must use the Pacman package manager, as follows −
sudo pacman -S imagemagick
Installing conjure Command in CentOS or Fedora
Similarly, we can use the dnf package manager to install the conjure command from ImageMagick on red hat-based distributions −
sudo dnf install ImageMagick
How to Use Conjure Command in Linux?
Let’s understand the basic syntax of the conjure command and its options to learn how it works in Linux −
Basic Syntax of conjure Command
To use the conjure command on Linux, you must follow the given syntax −
conjure [options] script.msl
Here, options represent optional flags or parameters to modify the conjure command.
conjure Command Image Settings and Options
Here are the options available for configuring image generation with the conjure command −
Image Settings | Description |
---|---|
-monitor | It monitors the progress. |
-quiet | It suppresses all warning messages. |
-regard-warnings | It pays attention to warning messages. |
-seed value | It seeds a new sequence of pseudo-random numbers. |
-verbose | It prints detailed information about the image. |
The below table illustrates the the additional options for debugging and obtaining information about the conjure command −
Option | Description |
---|---|
-debug events | It shows the debugging information. |
-help | It retrieves the conjure command option details. |
-log format | It specifies the format for debugging information. |
-list type | It shows the list of available/supported options or arguments. |
-version | It shows the installed version of the ImageMagick suite of tools. |
Man Page of conjure Command
For a profound understanding of the conjure command, you can access its manual page, as follows −
man conjure
Help Page of conjure Command
Similarly, you can access the help page of the conjure command to get the details like version number, copyrights, image settings, miscellaneous options, etc., as shown below −
conjure -help
How does the conjure Command Work?
Now let’s learn how the conjure command works in Linux using the following stepwise instructions −
Step 1: Creating a Script File
First, create a script file in an editor like Nano, and give it the extension .msl −
nano exampleScript.msl
Step 2: Writing MSL Commands
Write the code to perform a specific task. For instance, the below-mentioned code creates a PNG image, adds text to it, and saves it −
# Creating an image with a solid green color canvas 350x350 green # Adding text to the image annotate -fill white -gravity center -pointsize 24 "Welcome to tutorialspoint.com" # Saving the image to a file write mslImage.png
This will create an image having a solid green background and white text at the center of the image.
Step 3: Executing the Script Using conjure
Now run the conjure command with the file name to execute the MSL script −
conjure exampleScript.msl
Important Consideration − While executing this command, you may encounter an error stating “conjure-im6.q16: no decode delegate for this image format '@error/constitute.c/ReadImage/581”. To avoid this error, make sure the necessary libraries for the specified image format are installed on your system. For example, the following code snippet installs dependencies for the JPEG and PNG formats −
sudo apt install libjpeg-dev sudo apt install libpng-dev
This way, you can use the conjure command in Linux to run a script written in MSL.
Conclusion
Conjure is a command line utility of the ImageMagick suite of tools. This utility is used for interpreting and running Magick Scripting Language (MSL) scripts. It is not pre-install on most of Linux distributions, however, you can easily install it using a suitable package manager.
In this tutorial, we explored the Conjure command, its basic syntax, options, and practical examples. We covered the installation process on various Linux distributions, including Ubuntu, Arch Linux, and CentOS/Fedora.
We also examined how to access its manual and help pages for further guidance. Finally, we demonstrated the step-by-step process of creating and executing an MSL script with the Conjure command. Finally, we addressed potential errors and their solutions to ensure a smooth execution of MSL scripts.