Skip to content

Do not load image before converting - #10391

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:load
Nov 3, 2026
Merged

radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:load

Conversation

@radarhere

Copy link
Copy Markdown
Member

convert() internally calls load(), so there's no need to load() an image first.

Pillow/src/PIL/Image.py

Lines 1932 to 1936 in c3fd401

im.load()
if self.mode != im.mode:
if self.mode != "RGB" or im.mode not in ("LA", "RGBA", "RGBa"):
# should use an adapter for this!
im = im.convert(self.mode)

@radarhere
radarhere merged commit c7631b5 into python-pillow:main Nov 3, 2026
51 checks passed
@radarhere
radarhere deleted the load branch November 3, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant