Is there a way to save an image as 24 bit png? I didn't manage with GIMP. Keep in mind this is pixel art so keeping the exact colors are important.

I tried several things in GIMP, but it always said this:

$ file Junction.png 
Junction.png: PNG image data, 160 x 60, 8-bit/color RGBA, non-interlaced

Instead of 24 bit.

  • 8-bit/color is a 24 bit PNG (3 colors * 8 bits). Did you mean a 48 bit PNG (16-bit/color)?
    – cjm
    Nov 23, 2013 at 8:21
  • 1
    In paint.NET you can choose to save your picture 8bit, 24bit or 32bit. As there is no pain.NET on Linux and Pinta doesn't have it, I asked for it.
    – PMint
    Nov 23, 2013 at 14:42
  • It seems @cjm is (mistakenly) assuming the number of bits refers only to the color channels. But in an X-bit image 'X' refers to the number of bits of all the channels--unless the word "color" is specifically added after the X.
    – jiggunjer
    Dec 24, 2015 at 4:13
  • @jiggunjer, if you read my answer instead of just my comment, you'll see I'm aware of that.
    – cjm
    Dec 24, 2015 at 5:35
  • @cjm I did. I see now that we interpreted the OP in different ways. I assumed he was aware he had a 32bit image because his output was RGBA. You assumed he thought he had an 8bit image because of the output he pasted. Unfortunately OP was not very clear what he thought his output was.
    – jiggunjer
    Dec 24, 2015 at 7:50

3 Answers 3


Your problem is that you don't understand the output of the file command. I used Paint.NET to save an image as 32-bit PNG, 24-bit PNG, and 8-bit PNG. Then I ran the file command on them:

$ file *bit.png
08-bit.png: PNG image data, 800 x 600, 8-bit colormap, non-interlaced
24-bit.png: PNG image data, 800 x 600, 8-bit/color RGB, non-interlaced
32-bit.png: PNG image data, 800 x 600, 8-bit/color RGBA, non-interlaced

As you can see 8-bit/color RGBA is actually what Paint.NET calls a 32-bit PNG, because it's 8 bits per color * (3 colors + 1 alpha channel). 8 * 4 = 32. A 24-bit PNG is the same, but without the alpha channel: 8 * 3 = 24.

If you want what Paint.NET calls a 24-bit PNG, you need to remove the alpha channel. As far as I can tell, GIMP always exports a PNG with an alpha channel if any of your layers has an alpha channel.

If you're only using 1 layer, then it's simple: Go to Layer > Transparency > Remove Alpha Channel and then export. You'll get a 24-bit PNG.

If you're using multiple layers and need transparency effects, then jthill pointed out that you can use Image > Flatten Image to remove the layers with transparency before exporting. You can then Undo to restore the layers.

You can also post-process the exported PNG to remove the alpha channel. You could load the exported image back into GIMP, which will make it 1 layer, remove the alpha channel from that layer, and export again. A better way is to use optipng, which will usually compress a PNG better than GIMP can in addition to removing a useless alpha channel.


NOTE: If you're looking for 16-bits per channel support then this answer applies to that. Otherwise if you're miss understanding 24-bit support (8-bit * 3 colors (RGB) = 24-bits, then see @cjm's answer as to how to understand how that works.

From the GIMP FAQ:


When can we see 16-bit per channel support (or better)?

For some industries, especially photography, 24-bit colour depths (8 bits per channel) are a real barrier to entry. Once again, it's GEGL to the rescue. Work on integrating GEGL into GIMP began after 2.4 was released, and will span across several stable releases. This work will be completed in GIMP 3.0, which will have full support for high bit depths. If you need such support now and can't wait, cinepaint and Krita support 16 bits per channel now.

The current development branch, GIMP 2.9.x, supports higher bit depths than the 2.8 and older 8-Bit-per-component...

In case you're not familiar with GEGL:


GEGL (Generic Graphics Library) is a graph based image processing framework.

GEGL provides infrastructure to do demand based cached non destructive image editing on larger than RAM buffers. Through babl it provides support for a wide range of color models and pixel storage formats for input and output.


  • Floating point handling and processing and output of larger 8bit, 16bit integer and 32bit floating
  • ....
~/Documents$ file Untitled.png 
Untitled.png: PNG image data, 640 x 400, 8-bit/color RGB, non-interlaced

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .