Convert Image Between File Types

Have you ever wanted to convert a jpg into a png? Heck, have you ever wanted to convert 100 jpgs into 100 pngs? And instantly? If you have, you’ve probably experienced the frustration of not knowing what to do. Well, there’s actually a solution. It’s called ImageMagick.

What is ImageMagick?

ImageMagick is a command line image editing tool. In other words, it’s a program that runs in that little black window that hackers use.

Wait. Before you can use ImageMagick, make sure it is installed. On Mac, it is preinstalled with git, rename, ffmpeg and the rest of the other utilities. On Windows, it isn’t, so you have to manually install it.

How to use?

Easy. To convert a jpg into a png, open terminal and type

convert file.jpg file.png

And with that, file.jpg should be converted into file.png

What about converting 100 jpgs into 100 pngs? To do that, you use a different command

mogrify -format png *.jpg

Essentially this says, “take every file ending with jpg and format it as png”.

In addition to what I have demonstrated, there are actually many other ways you can use ImageMagick. For example, you can use it to convert an image to grayscale, add or subtract images from each other, among other things. If you’re interested in ImageMagick and want to learn more, I encourage you to visit http://www.imagemagick.org.

Leave a Reply

Your email address will not be published. Required fields are marked *