Skip to content

Palettized blitting? #6527

Answered by radarhere
TheRealQuantam asked this question in Q&A
Aug 23, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

It sounds to me like you're just describing paste() with box and mask arguments, and a crop() operation.

Using https://github.com/python-pillow/Pillow/blob/main/Tests/images/transparent.png,

from PIL import Image
im = Image.open("transparent.gif")
im2 = im.crop((0, 0, 100, 100))
im.paste(im2, (50, 50), im2.convert("LA"))
im.save("out.png")

gives

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@radarhere
Comment options

@TheRealQuantam
Comment options

Answer selected by radarhere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants