Save 16 bit grayscale PNG

Just starting out? Need help? Post your questions and find answers here.
User avatar
Xanos
User
User
Posts: 45
Joined: Sat Feb 28, 2015 1:20 pm

Save 16 bit grayscale PNG

Post by Xanos »

Hello,

the supported formats of the image library are quite limited.
Currently, I plan to work with 16 bit grayscale images and save them as .png file.
Did anybody by any chance already worked with this in Purebasic and can point me in the right direction?
Is this at all possible with the Purebasic image library to work with single-channel images (I don't think so) or do I have to use external libraries?

Thanks in advance.
Programming on Windows 10 Pro / Windows 7 Enterprise / Linux Mint 19 / Manjaro Linux with PB 5, Python 3 and Go
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3943
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Save 16 bit grayscale PNG

Post by wilbert »

The PNG format isn't very complicated.
You can write your own procedure to encode 16 bit grayscale values into PNG format.
The thing is, that it's pretty much useless if all of your image handling doesn't support 16 bit grayscale images.
Windows (x64)
Raspberry Pi OS (Arm64)
Post Reply