370
votes
Accepted
Trouble with batch conversion of .png to .pdf using convert
convert is a powerful command line tool to convert graphics. Its support for PDF is provided by Ghostscript. Because of a significant security hole in Ghostscript prior to version 9.24, use of convert ...
133
votes
Accepted
how to install imagemagick for php7 on ubuntu?
Just do:
sudo apt-get install php-imagick
This should install imagick for PHP 7.0.
102
votes
Trouble with batch conversion of .png to .pdf using convert
As vanadium posted, you have to change the ImageMagick policy.
sudo vim /etc/ImageMagick-6/policy.xml
and replace the line
<policy domain="coder" rights="none" pattern="PDF" />
with
<...
98
votes
Accepted
imagemagick - convert not allowed
ImageMagick has some security policies disabling some rights for security reasons. See why at the bottom of this answer.
You will have to edit a config file to re-enble the action you need.
Open /etc/...
87
votes
Accepted
dpkg: error processing package install-info
sudo mv /var/lib/dpkg/info/install-info.postinst /var/lib/dpkg/info/install-info.postinst.bad
Alternatively a shorter command:
sudo mv /var/lib/dpkg/info/install-info.postinst{,.bad}
Fixes the ...
77
votes
Accepted
ImageMagick:convert-im6.q16: no images defined
Interestingly enough ImageMagick under 19.04 (and other Ubuntu releases!) disables many ghostscript format types. This can be seen in this snippet from /etc/ImageMagick-6/policy.xml:
<!-- disable ...
46
votes
Accepted
ImageMagick convert can't convert to webp
Fixed in 16.04
In 16.04 convert flyer.png flyer.webp does work, although webp is needed:
sudo apt-get install webp
Without webp installed, this error message will show:
convert: delegate failed `"...
46
votes
I'm getting the message: "The following security updates require Ubuntu Pro with 'esm-apps' enabled" when updating Ubuntu 22.04
This is an additional support stream
From reddit.com/r/linux/, user Patch86UK:
For clarity: This is not a roadblock being put on an existing support stream, it is a new support stream. Previously ...
45
votes
I'm getting the message: "The following security updates require Ubuntu Pro with 'esm-apps' enabled" when updating Ubuntu 22.04
Here is a solution that doesn't require subscribing or registering. It removes the helpful look what you could get if you sign up message. This is not the most elegant, but it takes care of the ...
41
votes
Accepted
I'm getting the message: "The following security updates require Ubuntu Pro with 'esm-apps' enabled" when updating Ubuntu 22.04
I have found the solution. Run:
sudo pro enable esm-apps
and then update using the usual way and imagemagick and all related packages will be updated.
If Ubuntu Pro support is enabled on your Ubuntu ...
40
votes
how to install imagemagick for php7 on ubuntu?
Turns out I had to restart the fpm:
sudo service php7.0-fpm reload
Things I tried:
apt install php-imagick didn't work for me. The module was getting loaded for the PHP CLI (I checked with php -m | ...
35
votes
Is there a better way to redact a PDF?
You can use Okular.
sudo apt-get install okular
Open the pdf with Okular.
Press F6 (or go to Tools --> Annotations).
Press 8.
Highlight the text you wish to redact.
Right click the text, select ...
35
votes
Accepted
Where is the magick command of Imagemagick?
I can confirm, no magick command on my Ubuntu 20.04 either.
However, try convert:
$ convert --help
Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org
Copyright: © 1999-2019 ...
33
votes
Accepted
ImageMagick command line convert -limit values
I was able to find a solution through the ImageMagick forum.
The method was to change the settings for Resource limits in the file handling that in ImageMagick, called policy.xml. In Ubuntu 18.04 that ...
32
votes
Accepted
Is there a command to get the number of frames in a gif?
If you have ImageMagick installed, you can use its identify command as follows
identify /path/to/image.gif
You'll get details of each frame.
As suggested by steeldriver, you can get the number of ...
28
votes
I'm getting the message: "The following security updates require Ubuntu Pro with 'esm-apps' enabled" when updating Ubuntu 22.04
There are two possible solutions.
Solution 1: Enable the Pro repository.
That repository is not public, it's free for up to 5 machines, it requires setting up an account (email, username, password), ...
27
votes
Accepted
Convert PDF to images to PDF
Imagemagick rasterizes everything. You could simply do:
convert -density 200 input.pdf output.pdf
Of course the recipient might decide to run an OCR program on your file. The density parameter sets ...
25
votes
Trouble with batch conversion of .png to .pdf using convert
Rather than re-loosening ImageMagick's security restrictions, I'd just use img2pdf.
It's specifically designed for this kind of use-case.
You should use img2pdf if your priorities are (in this ...
22
votes
Is there a command to get the number of frames in a gif?
Exiftool will list the Frame Count as part of its extensive output.
This a command and output of an Animated Gif file:
$ exiftool -b -FrameCount giphy.gif
33
Full exiftool output on the gif:
$ ...
21
votes
how can I resize an animated GIF file using ImageMagick?
I was looking for imagemagick solution as I am familiar with it, but in the end I went with @sam's suggestion of gifsicle. It did just what I wanted, no hassle.
Can optimize resulting file size in so ...
21
votes
Accepted
ImageMagick PNG delegate install problems
You are making things a little too hard for yourself, here is a quick and dirty guide that ran well for me on Trusty Tahr:
First pick up a few known dependencies:
sudo apt-get install build-...
21
votes
How to add a border using Imagemagick
convert -bordercolor white -border 20 input.jpg output.jpg
will add a white border of size 20 pixels to image. You just need to find out how much px is an inch (dpi) of image.
More examples can be ...
21
votes
ImageMagick:convert-im6.q16: no images defined
Another reason for getting that same error is that the source images are too wide, too tall or too heavy.
The /etc/ImageMagick-6/policy.xml file controls what is acceptable as an image. Maximum width ...
20
votes
Accepted
How to bulk convert NEF/RAW images to JPG and remove original images?
Imagemagick cannot convert raw image files in recent Ubuntu versions because the ufraw-batch package is not available, due to it not being maintained anymore. We can however use darktable to do the ...
20
votes
I'm getting the message: "The following security updates require Ubuntu Pro with 'esm-apps' enabled" when updating Ubuntu 22.04
Have you actually tried going to https://ubuntu.com/pro ?
I just did, and after logging in, I received a "Free Personal Token" that never expires and includes up to 5 machines.
Then you just ...
19
votes
Accepted
How to install delegate libraries for Image Magick 7.0.7
It looks like you have simply skipped some of the required Bionic Beaver development libraries. Once these are installed you should be good to go!
1. 'Development' Files:
Easiest way to generate the ...
18
votes
Accepted
ImageMagick convert on a multiple files
It's frustratingly opaque in the documentation, but you can pass a quoted shell glob to convert (quoted to prevent the shell from expanding it prematurely), and use Filename Percent Escapes to ...
17
votes
Accepted
imagemagick crop images to specific aspect ratio?
Two things to consider:
Simple resizing with or without aspect ratio conversion
Cropping with aspect ration conversion
I address each in turn:
1. Simple resizing with or without aspect ratio ...
17
votes
how to install imagemagick for php7 on ubuntu?
For php 5.6: sudo apt-get install php5.6-imagick
For php 7.0:sudo apt-get install php7.0-imagick
For php 7.1: sudo apt-get install php7.1-imagick
For php 7.2: sudo apt-get install php7.2-imagick
For ...
17
votes
Accepted
How to remove ImageMagick without breaking its dependencies?
ImageMagick is a suite of command line tools and libraries for working with images and packages that depend on it or uses parts of it to function.
Cups uses it for its filters and while it's possible ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
imagemagick × 278image-processing × 73
command-line × 71
convert × 33
pdf × 29
bash × 19
14.04 × 13
apt × 13
16.04 × 12
package-management × 12
software-installation × 12
php × 12
png × 9
gif × 9
batch × 8
jpeg × 8
mogrify × 8
12.04 × 7
scripts × 7
convert-command × 7
18.04 × 6
gimp × 6
resize × 6
20.04 × 5
apache2 × 5