Skip to content

Instantly share code, notes, and snippets.

@nickferrando
Last active April 25, 2024 04:05
Show Gist options
  • Save nickferrando/fb0a44d707c8c3efd92dedd0f79d2911 to your computer and use it in GitHub Desktop.
Save nickferrando/fb0a44d707c8c3efd92dedd0f79d2911 to your computer and use it in GitHub Desktop.
Install ImageMagick with JPG, PNG and TIFF Delegates - Ubuntu (20.04)
#These are the steps required in order to Install ImageMagick with JPG, PNG and TIFF delegates.
sudo apt-get update
#Install Build-Essential in order to configure and make the final Install
sudo apt-get install build-essential
#libjpg62-dev required in order to work with basic JPG files
sudo apt-get install -y libjpeg62-dev
#libtiff-dev is required in order to work with TIFF file format
sudo apt-get install -y libtiff-dev
#libpng-dev required in order to work with basic PNG files
sudo apt-get install -y libpng-dev
#Download ImageMagick
wget https://www.imagemagick.org/download/ImageMagick.tar.gz
#Untar Imagemagick
tar xvzf ImageMagick.tar.gz
#Access the working directory
cd ImageMagick/[version_number]
#Configure and make sure to disable the "shared" option
./configure --disable-shared
#Make
sudo make
#Install
sudo make install
#Final Check
sudo make check
@nickferrando
Copy link
Author

You're welcome @shamsulaman786!

@tonyblaze27
Copy link

Hey, man! Thanks a lot, really! You saved me!

@nickferrando
Copy link
Author

I’m glad to hear this @tonyblaze27!

@julia-blake
Copy link

Thank you!!! It worked out finally

@nickferrando
Copy link
Author

Thank you!!! It worked out finally

Great @julia-blake!

@PushHandle
Copy link

PushHandle commented Apr 12, 2022

@nickferrando +1 @aamirencodes 'This page should be in the search results when a layman tries to installs ImageMagick for the first time in Linux environment'.

One question related to @aamirencodes note '#libjpg62-dev required in order to work with basic PNG files' :
I am seeing "Package libjpeg62-dev is not available." JPEG encode/decode works by installing the suggested replacement "libjpeg62-turbo-dev" but the PNG will not take.

Any thoughts?

Info:

Version: ImageMagick 7.1.0-29 Q16-HDRI x86_64 19841 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.5) 
Delegates (built-in): jbig jpeg tiff 
Compiler: gcc (10.2)

@PushHandle
Copy link

PushHandle commented Apr 13, 2022

Update If you are on a Pixelbook or Chromebook running Debian 11 - These installation steps worked for me:
https://www.linuxcapable.com/how-to-install-imagemagick-on-debian-11/

PNG, WEBP, TIFF, JPG all working!

@Kalyani-Borkar
Copy link

i am getting error > " no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/741"
how that needs to be resolved? i am having image magic 7.1.0.44 version

@nickferrando
Copy link
Author

Hello @Kalyani-Borkar,
sometimes HEIC library is not enabled after compilation, even if it's properly configured "--with-heic=yes".

You may want to check the following article, in order to fix the problem:

https://askubuntu.com/questions/1131996/problems-with-compiling-imagemagick-with-heic/1142317#1142317

@Kalyani-Borkar
Copy link

Thank you nickferrando, by following above steps i was able to resolve issue

@nickferrando
Copy link
Author

@Kalyani-Borkar
Copy link

Kalyani-Borkar commented Jul 27, 2022

error "magick.MagickApiException: unable to open image `/tmp/925861962_1658920855718_50.png': No such file or directory @ error/blob.c/OpenBlob/2874"
how could i resolve this?

@shamsulaman786
Copy link

shamsulaman786 commented Jul 27, 2022

I think your file permission has been changed. please give it permission using the below command:
sudo chmod 777 /path/to/image-file or sudo chmod 777 -R /path/to/parent/directory/of/image-file
I hope it will work

@Kalyani-Borkar
Copy link

For which file/Folder error comming how i get to know that in this case?

@lhmathies
Copy link

On Microsoft's packaged Ubuntu 20.04 for WSL I found that I needed to install pkg-config before configure would find libpng. (And a lot of other delegates: At least [jng lzma png ps tiff zlib] all seem to need pkg-config to be detected, and possibly others that are genuinely not there on my system).

@btlorch
Copy link

btlorch commented Oct 12, 2022

On Microsoft's packaged Ubuntu 20.04 for WSL I found that I needed to install pkg-config before configure would find libpng. (And a lot of other delegates: At least [jng lzma png ps tiff zlib] all seem to need pkg-config to be detected, and possibly others that are genuinely not there on my system).

Thanks, installing pkg-config solved it for me on Ubuntu 22.

@djl314
Copy link

djl314 commented Nov 6, 2022

6 hours down the drain today... YOU ARE A LIFESAVER! thx

@darkwingdck
Copy link

I have no words for how this helped me. Thank you!

@nickferrando
Copy link
Author

I have no words for how this helped me. Thank you!

That's great to hear @darkwingdck!

@alm494
Copy link

alm494 commented Mar 7, 2023

This does not work on Ubuntu 22/04. No delegation for PNG etc. Tried all the way and installed all required libraries.

@lhmathies
Copy link

@alm494, did you check if the pkg-config package is present? ./configure doesn't even try to find the PNG libraries if it doesn't have that.

@sibs-wang
Copy link

thank you for this:)

@rtanglao
Copy link

rtanglao commented Apr 7, 2023

sudo apt install pkg-config made PNG and other delegates work for me as well on Ubuntu 22.04 Dell XPS13

@JVKeller
Copy link

JVKeller commented Jun 5, 2023

sudo apt install pkg-config made PNG and other delegates work for me as well on Ubuntu 22.04 Dell XPS13

This worked for me for getting PNG added to the delegates list, but now I'm having a hard time getting FFTW enabled.

Fixed for FFTW I must have installed the wrong package so the script was not detecting it.
sudo apt-get install libfftw3-dev libfftw3-doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment