Move an icon one pixel to the right in a toolbar strip, rerun the build, then crop the icon back out. Should it match the previous build pixel for pixel?
With a 4 × 4 Bayer dither applied to the whole strip, a one-pixel shift can change the answer. In this test, moving a 24 × 24 Axialis icon from x = 0 to x = 25 changed the RGB values of 324 pixels. At x = 52, every pixel matched the reference.
One icon, three positions
I used the 24 × 24 Folder Doc PNG included in the Axialis Flat Design sample pack. I placed three exact copies at x = 0, 25, and 52 on a transparent 76 × 24 strip, all on the same row. The second copy sits one pixel off the 24-pixel grid. The third is farther away, at a multiple of four.
A Pillow script reduced each RGB channel to four levels using a 4 × 4 Bayer matrix and copied the alpha channel through unchanged. I saved the strip as PNG, reopened it, cropped out the three tiles, and compared each to the crop at x = 0.
| Workflow | RGB pixels changed at x = 25 | RGB pixels changed at x = 52 |
|---|---|---|
| Pack the original PNGs | 0 | 0 |
| Pack first, then dither the whole strip | 324 | 0 |
| Dither the icon first, then pack the tiles | 0 | 0 |
I counted differences only where alpha was greater than zero. The source tile had 416 such pixels, including partially transparent edges. Alpha matched the original at every position in all three workflows. The exact RGB count depends on the icon and the reduction settings.
Why the position matters
Ordered dithering repeats a small grid of thresholds across the image. For this test, the threshold at an image coordinate is BAYER[y % 4][x % 4]. Take the same local pixel in each copy. At x = 25, it encounters a threshold one column farther along in the repeating pattern because 25 % 4 == 1. At x = 52, it lands in the same column as the reference because 52 % 4 == 0.
That can send the same original RGB value to a different output level. The change happens when the script reduces the colors. PNG encoding preserves the resulting pixels.
Where this fits in an Axialis workflow
Axialis IconGenerator can generate PNG strips for toolbars and image lists, as well as individual PNG icons. Its documented PNG export is 32-bit with alpha. For this experiment I used the ready-made PNG from the pack, with Pillow handling the color reduction.
If your build needs reduced-color icons that stay pixel-identical when you reorder them, export individual PNGs, apply the same color reduction starting at each icon’s own top-left corner, then pack the processed tiles. If you have to process the entire strip in one pass, every tile origin must share the same coordinates modulo four on both axes to get the same Bayer alignment.
Reproduce the test
Use any 24 × 24 RGBA icon. The snippet was tested with Pillow 13.0. The script prints the number of pixels with changed RGB values in each cropped tile, compared with the first tile in the same strip.
from io import BytesIO from PIL import Image BAYER = ( (0, 8, 2, 10), (12, 4, 14, 6), (3, 11, 1, 9), (15, 7, 13, 5), ) OFFSETS = (0, 25, 52) def dither(image): result = image.copy() src, dst = image.load(), result.load() for y in range(image.height): for x in range(image.width): r, g, b, alpha = src[x, y] if alpha == 0: continue threshold = 2 * BAYER[y % 4][x % 4] + 1 rgb = [] for value in (r, g, b): level, remainder = divmod(3 * value, 255) level += 32 * remainder > 255 * threshold rgb.append(85 * level) dst[x, y] = (*rgb, alpha) return result def pack(tile): strip = Image.new("RGBA", (76, 24)) for x in OFFSETS: strip.paste(tile, (x, 0)) return strip def crop_png(strip): buffer = BytesIO() strip.save(buffer, format="PNG") buffer.seek(0) with Image.open(buffer) as png: return [png.crop((x, 0, x + 24, 24)) for x in OFFSETS] icon = Image.open("folder-doc.png").convert("RGBA") assert icon.size == (24, 24) original = pack(icon) for label, strip in ( ("Original", original), ("Whole strip", dither(original)), ("Per tile", pack(dither(icon))), ): assert strip.getchannel("A").tobytes() == original.getchannel("A").tobytes() crops = crop_png(strip) reference = tuple(crops[0].get_flattened_data()) print(label, [ sum(a[3] > 0 and a[:3] != b[:3] for a, b in zip(reference, crop.get_flattened_data())) for crop in crops ]) 


