Skip to content

Simple PNG differs between 11.0.0 and 11.1.0 (macOS only) #8749

@dolfim-ibm

Description

@dolfim-ibm

What did you do?

I create a simple image with ImageDraw, and then save to PNG.

What did you expect to happen?

Independent from which OS and which Pillow version, the file should be the same.

What actually happened?

With version 11.1.0, and only on macOS, the output between Pillow 11.0.0 and 11.1.0 is different.

In Linux, the same example is correct.

What are your OS, Python and Pillow versions?

  • OS: macOS 15.3.1
  • Python: 3.12
  • Pillow: 11.1.0 and 11.0.0
--------------------------------------------------------------------
Pillow 11.1.0
Python 3.12.7 (main, Oct  1 2024, 02:05:46) [Clang 15.0.0 (clang-1500.3.9.4)]
--------------------------------------------------------------------
Python executable is /Users/dol/scratch/pillow-scratch/venv-11.1.0/bin/python3
Environment Python files loaded from /Users/dol/scratch/pillow-scratch/venv-11.1.0
System Python files loaded from /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12
--------------------------------------------------------------------
Python Pillow modules loaded from /Users/dol/scratch/pillow-scratch/venv-11.1.0/lib/python3.12/site-packages/PIL
Binary Pillow modules loaded from /Users/dol/scratch/pillow-scratch/venv-11.1.0/lib/python3.12/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 11.1.0
*** TKINTER support not installed
--- FREETYPE2 support ok, loaded 2.13.2
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.5.0
--- JPEG support ok, compiled for libjpeg-turbo 3.1.0
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.3
--- ZLIB (PNG/ZIP) support ok, loaded 1.3.1.zlib-ng, compiled for zlib-ng 2.2.2
--- LIBTIFF support ok, loaded 4.6.0
--- RAQM (Bidirectional Text) support ok, loaded 0.10.1, fribidi 1.0.16, harfbuzz 10.1.0
*** LIBIMAGEQUANT (Quantization method) support not installed
--- XCB (X protocol) support ok
--------------------------------------------------------------------
import importlib.metadata
from PIL import Image, ImageDraw

version = importlib.metadata.version("Pillow")
print(f"{version=}")

size = (16, 16)
im = Image.new("RGB", size, "black")
draw = ImageDraw.Draw(im)
draw.ellipse((0, 0, size[0] - 1, size[1] - 1), fill="red")

im.save(f"im-{version}.png", format="PNG")

This generates files like im-11.0.0.png, im-11.1.0.png, im-11.2.0.dev0.png (from the current main).

On mac

$ diff im-11.0.0.png im-11.1.0.png
Binary files im-11.0.0.png and im-11.1.0.png differ

$ diff im-11.0.0.png im-11.2.0.dev0.png
no diff

On linux

$ diff im-11.0.0.png im-11.1.0.png
no diff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions