Linux Applications

ImageMagick Sharpen Image

“Editing photographs, changing their formats, renaming images, and doing numerous operations on multiple files at once are frequent tasks. Both vector and raster images can be shown, converted, and edited using the free and open-source software “ImageMagick”. John Cristy created it in 1987 while he was employed by DuPont. He utilized it to create several of his creations and compress 24-bit photos to 8-bit graphics. Once he transferred the ownership to ImageMagick Studio LLC in 1990, it was publicly disclosed. It provides rudimentary API-like capabilities for UNIX-like computers but lacks a full GUI like Adobe Photoshop, Lightroom, and GIMP. Numerous image file types are supported, including GIF, JPEG, PNG, Postscript, and TFF.”

Installing ImageMagick by apt Package Library

Step 1: It is rather simple to set up ImageMagick using the apt (Advanced Package Tool) tool to conduct tasks, including replacing old software platforms, contributing significant software solutions, renewing the source list index, and even rebuilding the complete Ubuntu system. The software is currently accessible through the default Ubuntu source. Update the file first, then launch a terminal and type these commands.

Step 2: To view the image in the terminal, first install the ImageMagick and then use the display command. The commands listed below to install ImageMagick  edition 6.9.11-60:

Using the sudo command, also referred to as the user logs do or swap user do, users with the appropriate permissions can run an instruction as the systems analyst. The command prompt tool for managing software is called apt-get. It is used to install packages when apt-get is used after the setup process. Following installation, a list of several modules could appear by enclosing the configuration file in an equivalent (=) sign as well as the edition of the module that is needed, a particular edition of the module can be requested to be installed. Two modules, ImageMagick and PHP-Imagick, are chosen to be acquired to set up the ImageMagick program.

Step 3: Users should check its configuration. As part of ImageMagick’s toolkit, the identifying program is utilized to accomplish this. On Ubuntu 22.04, the installed version of ImageMagick can be printed using the command prompt:


The response reveals that its edition downloaded from Ubuntu 22.04’s official library is ImageMagick 6.9.11-60.

Putting an Image on Display

The displaying feature of ImageMagick is a fundamental utility. Whenever displaying the image, one must always utilize the prompt to navigate to the directory. Specify the address of the folder that contains the image that is being shown:



It shows the picture “pixels-4348401.jpg”.

Steps for Image Backup

Whenever making any modifications to an image, it is constantly required to create a copy of it. Always duplicate the original image before making any simple adjustments, such as blurring, cropping, or applying a filter. Everyone should adhere to this advanced encryption technique. The actual picture remains intact if there is a converting issue.

The procedures listed below can be used to create a version of the original image.


mv” is short for moving. Users must specify the “mv” in which the file is located and where it needs to go to relocate a file. It should be noted that moving a file to a directory where another file already resides will replace the older version. Through this command, you can also change the title of the file_name.

Inside the aforementioned example, Line 1 of the command altered the file name pixels.

“cp” stands for a copy. Nearly everybody who interacts with Unix conducts the process of moving files and directories regularly. It isn’t as easy to move a file into another session on your machine while using the command prompt, though. Instead, you must copy files and folders using the “cp” command. Using this command, you can copy a path, a collection of documents, or both. With a changed file name, it generates an identical replica of the disc file.


In the aforementioned illustration, Line 3 creates a duplicate of the original file with a separate file name.

Utilizing the Sharpen Command

The converted command in ImageMagick, which provides the form of conversion and additional parameters in addition to it, can be utilized for any basic conversions. There are numerous operations included in the conversion command, and a description of them may be seen on ImageMagick’s official website.

Due to the severity of time and nature, the majority of photographs recovered from ancient discoveries are imprecise and require some smoothing before even being published on social media. The Video surveillance data is frequently also grainy for surveillance purposes. The sharpen command should be used in the manner described below.

The radius should always be twice sigma and has an integer value. It must be at least 1 to allow for speedier processing. The sigma is the most crucial element. Given that it is the actual controller of the sharpening process. Giving the 2-D Gaussian are:

where z is a column vector that contains the image’s x and y coordinates, changing the variance while maintaining the same pixel count will result in distinct visuals. Sigma is hence a crucial aspect in defining how the image will appear.

Before applying the sharpen operation to an image, blur it using the blur command, which accepts the same arguments as the sharpen command.

The image can then be sharpened in the following ways:

The image will then be displayed on the screen using the display command.

Conclusion

The image processing software called ImageMagick is a collection of utilities. We discovered a few things during this article. The software package is open-source, freely downloadable, and open to distribution. To make it easier for viewers to understand an image’s content, the sharpen command can assist reduce an image’s blurry look. This is quite helpful in a variety of situations, including tracking down images taken with an old camera and identifying offenders. Only the simplest basic data is provided here. However, if you’re capable of handling the basics, you can tackle the difficult topics.

About the author

Omar Farooq

Hello Readers, I am Omar and I have been writing technical articles from last decade. You can check out my writing pieces.