changed most PIL paste() calls into composite.alpha_over() calls
The ones I have not changed are those where paste() is really preferred, and I've noted why in comments. Calls to "dest.paste(src, rect, mask)" were converted to calls to "composite.alpha_over(dest, src, rect, mask)".
This commit is contained in:
@@ -29,6 +29,7 @@ import util
|
||||
from PIL import Image
|
||||
|
||||
from optimizeimages import optimize_image
|
||||
import composite
|
||||
|
||||
|
||||
"""
|
||||
@@ -449,7 +450,10 @@ def render_innertile(dest, name, imgformat, optimizeimg):
|
||||
|
||||
# Create the actual image now
|
||||
img = Image.new("RGBA", (384, 384), (38,92,255,0))
|
||||
|
||||
|
||||
# we'll use paste (NOT alpha_over) for quadtree generation because
|
||||
# this is just straight image stitching, not alpha blending
|
||||
|
||||
if q0path:
|
||||
try:
|
||||
quad0 = Image.open(q0path).resize((192,192), Image.ANTIALIAS)
|
||||
@@ -613,7 +617,7 @@ def render_worldtile(chunks, colstart, colend, rowstart, rowend, path, imgformat
|
||||
xpos = -192 + (col-colstart)*192
|
||||
ypos = -96 + (row-rowstart)*96
|
||||
|
||||
tileimg.paste(chunkimg.convert("RGB"), (xpos, ypos), chunkimg)
|
||||
composite.alpha_over(tileimg, chunkimg.convert("RGB"), (xpos, ypos), chunkimg)
|
||||
|
||||
# Save them
|
||||
tileimg.save(imgpath)
|
||||
|
||||
Reference in New Issue
Block a user