The PNG Utilities REALbasic Plugin enables users to import and export PNG images, with the option to include transparency data.
The PNG format is an efficient lossless compression technique enabling support for real colour images with or without alpha channels. PNG files preserve image fidelity and transparency information while maintaining optimal file size. This is where PNG Utilities Plugin comes in, allowing REALbasic developers to load and save PNG images effortlessly, while importing and exporting transparency masks seamlessly.
Notably, the source code for PNG Utilities is freely available for use without credit. However, any changes made to the source code should be sent back so that it can be included in future releases. Additionally, it's essential to note that the libpng and zlib libraries come included under their respective license agreements in this distribution.
To use the tool, download and place the PNG Utilities Plugin.rbx file into your REALbasic plugin folder, then launch REALbasic. From there, you can choose various methods from the PNGu module to manipulate your PNG files. Please refer to the method reference document and example project included for detailed information.
Although Linux builds dynamically link with libpng and zlib at runtime, PNG Utilities will not function without these libraries. Notably, they are usually included in Linux distributions and do not require any additional installation. However, the Mac and Win32 plugins are self-contained, making them ideal for use.
While PNG Utilities can load all valid PNG file formats, it saves only true-colour 8bpp RGB and RGBA formats. Additionally, gamma correction is applied destructively when loading a PNG image, meaning that the original RGB data no longer exists within the REALbasic Picture object. To avoid this, you can pass a gamma value of -1 when loading and/or saving PNG images.
Moreover, vector pictures (Pictures with Depth = 0) need to be converted into a bitmap before sending them to the Save/GetData methods. Picture.Transparent flags are not converted to alpha channels when using the Save/GetData methods. PNGs with valid Mask properties will result in an alpha channel. Masks should be grayscale, considering that REALbasic treats black as opaque, while alpha channels treat black as transparent.
In conclusion, PNG Utilities REALbasic Plugin is an essential tool for any REALbasic developer. It requires REALbasic 5.5+, and it supports 16 bpp (48 & 64 bit) PNG images, which now load and display correctly.
Version 1.8.1: N/A