P4 Software
/
BarcoderX English
Applies to: BarcoderX Basic and Ultimate
Status: Built, not yet released. The PNG writer exists and is tested, but nothing is released yet and there is nothing to download. Turning a whole label into a PNG file needs the label engine, which is not built yet. This page says what the writer does today and what it does not do yet.
PNG is the picture format BarcoderX uses for previews, web pages and any other use where you need a picture of a label. See Output formats for the other formats. This page describes the PNG writer itself: the part that takes the pixels of a picture and writes a valid PNG file.
BarcoderX writes the PNG file with its own code. The only part it takes from .NET is the compression of the picture data.
You give the writer the pixels of a picture, its width and height, and which kind of pixels they are. These kinds are accepted:
| Kind of picture | What each pixel holds |
|---|---|
| Color with transparency | Red, green, blue and opacity, 8 bits each. Opacity is "straight": the color is not already multiplied by it. If your pixels are premultiplied, convert them first. |
| Color | Red, green and blue, 8 bits each. |
| Gray | One 8-bit value, 0 is black. |
| Black and white, 1 bit | Eight pixels to a byte, the leftmost pixel in the highest bit, each row padded to a whole byte. You can give it in either of two conventions: where 1 means black (the convention of a label bitmap), or where 1 means white (the convention of PNG itself). The file always follows the PNG convention. |
| Palette | An 8-bit number for each pixel that points into a palette of 1 to 256 colors. Each palette color can have its own opacity. The writer stores the numbers at the smallest size that holds the palette: 1, 2, 4 or 8 bits. |
BarcoderX checks every limit before it allocates any memory, so a picture that is too large is refused at once, not after the computer has run out of memory.
| Limit | Value |
|---|---|
| Pixels in one picture | 64,000,000 (64 million) by default. The program that calls the writer can set a different limit. |
| Width and height | At least 1 and at most 2,147,483,647 each, as the PNG standard requires. The pixel limit is reached long before that. |
| Palette | 1 to 256 colors. A palette is allowed only with palette pictures, and every pixel must point to a color that is in it. |
| Resolution | A positive, finite number of dots per inch. |
| Length of the pixel data | Must match the width, height and kind of picture exactly. |
A picture that breaks a limit is not written. The writer reports a clear reason, with a diagnostic code from 3100 to 3106. See Diagnostic codes. A running job can also be canceled between rows.
In BarcoderX's automatic tests, the PNG files for ten test cases are identical, byte for byte, on Windows x64, Linux x64 and Linux arm64. The cases use six pictures, five small ones and one of about 600 KB before compression, some of them at several compression levels.
Read this with care:
The part that BarcoderX writes itself, the prepared rows before compression, is tested on every platform and does not depend on .NET.
BarcoderX is a product of P4 Software.
Was this page helpful?