GIMP save PNG in 16 and 24 bit

5

3

I have a .png image which I need to save in 24 and 16bit using gimp. I went to Image -> Mode -> Indexed, but maximum value is 256 colors. I tried to paste in 16777216 colors for 24bit, but it did revert back to 256. I also tried 16bit 65536 colors, but it also reverted back. I'm using OSX gimp version, don't know if it changes anything. I need this for school. In photoshop it's a lot easier, but unfortunately I can't use photoshop.

Image:

enter image description here

mypoint

Posted 2015-10-19T10:41:12.707

Reputation: 53

I don't know Gimp at all, so can't give you the actual answer - but why are you trying to convert it to indexed colour which is maximum 8-bit?

– Tetsujin – 2015-10-19T11:10:54.217

I have never used GIMP so I don't know any other way to convert it. :/ – mypoint – 2015-10-19T11:12:25.283

but you don't want indexed colour - read the link – Tetsujin – 2015-10-19T11:12:46.720

I had a bad idea that I should not, but that was the only place I could find in GIMP that actually changes something. – mypoint – 2015-10-19T11:13:48.563

For those of you landing on this question from google wondering what bpp formats are supported by .png, Wikipedia has a nice table here, note that the smallest bit per channel value for a color image is 8, there is no such thing as 4 bits per channel color. Note that .BMP does seem to support "4 bits per color component", though.

– jrh – 2016-12-13T14:03:40.743

Also, related topic on Unix.SE

– jrh – 2017-11-03T20:51:21.270

There is no 24bit PNG. The maximum bit depth for png is 16bit. Perhaps you meant PNG-24 which refers to something else entirely. – Nikos – 2020-01-23T13:03:20.297

Answers

1

For 16 bit you need to change the image mode to grayscale, with only two channels - grayscale and alpha - and save that as PNG. Then you have a 16 bit image.

  • Open a color JPEG
  • Change the mode to grayscale - it should have one layer now
  • Add an alpha layer
  • Save the image to PNG via the export menu

You need to test which options you need to check in the export menu. I've checked them all, and that creates a 16 bit grayscale image with an alpha layer.

Lolcat 16 bit

SPRBRN

Posted 2015-10-19T10:41:12.707

Reputation: 5 185

I found this image too, but I don't have such option :( – mypoint – 2015-10-19T12:04:30.050

2

Please note that this is the precision per RGBA component - if you choose 16 bit integer there, you will get an image with up to 64 bit (16 bit per R, G, B and A component). See https://en.wikipedia.org/wiki/Portable_Network_Graphics#Pixel_format

– Michael Schumacher – 2015-10-19T12:07:04.480

Thanks for that insight. For this question you would need to save the image without transparency, and I have no idea how to that. In Photoshop there is a checkbox if I remember correctly. Here I don't see one. – SPRBRN – 2015-10-19T12:11:51.630

Gimp is very confusing to use. – mypoint – 2015-10-19T12:21:08.497

(1) Why can't you use Photoshop - because you don't have it, of because you're force to use Gimp? If this is about learning Gimp, then tell us so we know this has to be a Gimp solution. If not, there are several alternatives to get around this. (2) Why do you need a 16 bit PNG? Is that school assignment? Does that even exist? Maybe this is just to challenge you and see what you come up with. The answer could be: it doesn't exist. – SPRBRN – 2015-10-19T12:31:24.907

The only way to get 16 bit is converting to grayscale, then there's 8 bit for the grayscale, and 8 bit for the alpha. But when I export to PNG, and reopen it, it reports 4 channels. Still I guess this is the way to get there. – SPRBRN – 2015-10-19T12:36:44.833

@SPRBRN tried using Greyscale and Alpha, but it gives 32bit :/ :( Why gimp is so frustrating...? – mypoint – 2015-10-19T14:37:37.667

@SPRBRN I do have Photoshop, but I am not allowed to use it for this school assignment. That's because I have to take screenshots of step-by-step process of how I got image to be 24bit 16bit and so teacher can compare to other students. I got around the problem by using nightly build version of gimp that has precision option. – mypoint – 2015-10-19T15:25:22.803

I've solve it. See my updated answer and the included picture. – SPRBRN – 2015-10-19T15:40:35.667

@SPRBRN I did excatly the same, but I get 32bit image.... I added image that I need to make 16bit in the original post. – mypoint – 2015-10-19T17:08:13.697

I'm not going to do your assignment. I've given a solution. You can download my image and see if it's 16 bit or not. Follow my exact solutions - so export with all options checked (and do not save for web). I tried again with your image and that worked for me. – SPRBRN – 2015-10-20T07:53:50.257

If the answer has helped you fix your problem, accept the answer and upvote useful comments. – SPRBRN – 2015-10-20T15:36:33.750

5

I have found that only Gimp 2.9 (the development branch) can save 16bit PNG. In Gimp 2.9 there is a "precision" menu option which lets you pick the precision. It is also capable of saving 16bit PNG, which Gimp 2.8 appears incapable of (even if you load a 16bit PNG, it will export it as 8bit).

Blake Walsh

Posted 2015-10-19T10:41:12.707

Reputation: 151

2

Don't use Indexed, use RGB. However, I think that GIMP lacks of the 16 bit option, only 24 or 32 bits.

Indexed images contains 256 colors or less. This always result in fading shades or patches in areas with color changes.

jcbermu

Posted 2015-10-19T10:41:12.707

Reputation: 15 868

Thanks! :) But how do I save it in 24bit ? Gimp seems complex. – mypoint – 2015-10-19T11:20:12.163

I did google and to get 24bit I just have to export as png and it will be 24bit. Now how do I get 16bit ? – mypoint – 2015-10-19T11:30:31.517

116 bits .png files are not supported on GIMP. – jcbermu – 2015-10-19T11:41:37.880

Just in case it isn't obvious: 32 bit* PNG files have an alpha channel (8 bit per R, G, B and A = 32 bit), 24 bit PNG file don't (8 bit per R, G and B = 24 bit). [* still ambiguous if we take 16-bit-per-component Gray+Alpha PNG files into account]. – Michael Schumacher – 2015-10-19T12:10:21.787

@MichaelSchumacher So for 16bit I need Gray and add alpha ? – mypoint – 2015-10-19T14:05:56.480

1Grayscale and alpha mode gives me 32bit image. Grayscale gives me 8bit – mypoint – 2015-10-19T14:12:59.057

Usually, what you need should be obvious from the context. You didn't provide much of that in your question. What task will the images be used for? – Michael Schumacher – 2015-10-19T16:00:06.083

@MichaelSchumacher It will not be used for anything. I only need to show step-by-step how I got the image to be 16bit and show the 16bit image. – mypoint – 2015-10-19T17:01:11.373