As well as being a developer, I am an artist. I make most of my artwork with GIMP and I save my artwork into a folder in jpg format. I now make sure that a transparent layer was not accidentally added at some point and then the image not flattened before saving it, however, in the past I was not aware of the signs that my image was being saved with a transparent background so that is a little bit of a nuisance to me that out of my over 300 pieces of artwork in that folder, maybe somewhere from 50-100 of them have transparent background which I do not want to be present.

So I was wondering if there is a way to automatically remove the transparency from all the jpgs in said folder without losing any quality or causing other issues?

I am running Ubuntu GNOME 17.04 with GNOME 3.24.

  • 2
    Don't worry. JPEG does not support transparency hence you have flattened all the pictures without even realizing it. :) – Andrea Lazzarotto May 14 '17 at 10:37
  • @AndreaLazzarotto: Really? That's great news! Please post that as an answer! :) – user364819 May 14 '17 at 10:38

The JPEG format does not support transparency

I am not sure why you are worried about inadvertently saving transparency information, but you can be sure this is not possible. You have actually flattened all the pictures without even realizing it and you don't need to do any further processing.

Note: JPEG2000, which is a different file format supports transparency.

Removing the transparency from other pictures

If you also have PNG files or other formats with transparency, you can flatten them on a color of your choice with ImageMagick:

mogrify -flatten -background white *.png

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy