I have issues with imagemagick on my machine, and hence am looking for an alternative that can be used to convert images from JPEG to PNG on the command line. The tool must run on Linux, and preferably should be available for free.

  • What is the issue with imagemagick that you need something "in addition"? Your question body doesn't tell.
    – Izzy
    Mar 26, 2017 at 18:01
  • I install imagemagick but I have a problems whit jpg convert with library version Mar 26, 2017 at 18:02
  • 1
    If you need help solving issues with software you're using, SR isn't the right place (SuperUser might be, but they would need much more details as well). If you are looking for alternative software, please see How to ask for an alternative to some software and What is required for a question to contain "enough information"? We cannot recommend anything if we don't know what you need.
    – Izzy
    Mar 26, 2017 at 18:04
  • I use graphicsmagick for complete this task Mar 26, 2017 at 18:15
  • 1
    Thanks for self-answering, Alejandro. I've edited your question to give you an example how the body should look like to not get it closed as being unclear. Enjoy your solution – and please take care for the body of your questions ;)
    – Izzy
    Mar 26, 2017 at 18:32

2 Answers 2


With convert:

ls -1 *.jpg | xargs -n 1 bash -c 'convert "$0" "${0%.jpg}.png"'

with mogrify (note that is part of imagemagick, but could work yor you):

mogrify -format png /path/*.jpg

With parallel:

parallel convert '{}' '{.}.png' ::: *.jpg

I used graphicsmagick to complete this task. To install it on Ubuntu:

sudo add-apt-repository ppa:dhor/myway
sudo apt-get update
sudo apt-get install graphicsmagick

Converting an image then can be done as follows:

gm convert input.jpg output.png
  • Actually multiple repositories and installing software without using the system apackage manager are the key to breaking system apps. The only way imagemagick can fail due to library versions in a Ubuntu system is by doing something like that (configuring a rogue PPA for example)
    – jsbueno
    Mar 27, 2017 at 12:14
  • @jsbueno, Re "a rogue PPA": Please clarify whether you believe ppa:dhor/myway to actually be a rogue PPA, (i.e. infected or harmful), or if you're merely offering general words of caution.
    – agc
    Apr 4, 2017 at 15:01
  • Just general words of caution. As later in 2016, I managed to all but wipe out my system by just putting a PPA which was badly configured and replaced some packages it should not have.
    – jsbueno
    Apr 4, 2017 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.