From be720c5e0d786c8ff3bf681c5ef2553fadac3d28 Mon Sep 17 00:00:00 2001 From: Alejandro Aguilera Date: Thu, 28 Apr 2011 15:03:59 +0200 Subject: [PATCH] Use ANTIALIAS filter for resizing down images. Ajust the position of fences for the new filter. --- textures.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/textures.py b/textures.py index ac214b5..567942a 100644 --- a/textures.py +++ b/textures.py @@ -123,12 +123,12 @@ def transform_image(img, blockID=None): if blockID in (81,92): # cacti and cake # Resize to 15x15, since the cactus and the cake textures are a little smaller than the other textures - img = img.resize((15, 15), Image.BILINEAR) + img = img.resize((15, 15), Image.ANTIALIAS) else: # Resize to 17x17, since the diagonal is approximately 24 pixels, a nice # even number that can be split in half twice - img = img.resize((17, 17), Image.BILINEAR) + img = img.resize((17, 17), Image.ANTIALIAS) # Build the Affine transformation matrix for this perspective transform = numpy.matrix(numpy.identity(3)) @@ -168,7 +168,7 @@ def transform_image_side(img, blockID=None): img = n # Size of the cube side before shear - img = img.resize((12,12)) + img = img.resize((12,12), Image.ANTIALIAS) # Apply shear transform = numpy.matrix(numpy.identity(3)) @@ -184,7 +184,7 @@ def transform_image_slope(img, blockID=None): in the -y direction (reflect for +x direction). Used for minetracks""" # Take the same size as trasform_image_side - img = img.resize((12,12)) + img = img.resize((12,12), Image.ANTIALIAS) # Apply shear transform = numpy.matrix(numpy.identity(3)) @@ -1066,9 +1066,9 @@ def generate_special_texture(blockID, data): # Compose the fence big stick fence_big = Image.new("RGBA", (24,24), (38,92,255,0)) - composite.alpha_over(fence_big,fence_side, (4,4),fence_side) - composite.alpha_over(fence_big,fence_other_side, (8,4),fence_other_side) - composite.alpha_over(fence_big,fence_top, (-1,1),fence_top) + composite.alpha_over(fence_big,fence_side, (5,4),fence_side) + composite.alpha_over(fence_big,fence_other_side, (7,4),fence_other_side) + composite.alpha_over(fence_big,fence_top, (0,1),fence_top) # Now render the small sticks. # Create needed images