diff --git a/pyproject.toml b/pyproject.toml index 306928d..8e40954 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ classifiers=[ ] dynamic = ["version"] dependencies = [ - "Pillow>=9.0.0", + "Pillow==9.5.0", "defusedxml", "pi3d>=2.49", "PyYAML", diff --git a/src/picframe/mat_image.py b/src/picframe/mat_image.py index 03e5ccc..62bd138 100644 --- a/src/picframe/mat_image.py +++ b/src/picframe/mat_image.py @@ -206,7 +206,7 @@ def __style_float_color_wrap(self, images): self.__add_image_outline(image, color2) image = ImageOps.expand(image, border_width) self.__add_image_outline(image, color, outline_width=border_width) - highlight = self.__9patch_highlight.render(image.width, image.height) + highlight = self.__9patch_highlight.render(image.width, image.height, Image.Resampling.LANCZOS) image.paste(highlight, (0, 0), highlight) image = self.__add_drop_shadow(image) final_images.append(image) @@ -337,12 +337,12 @@ def __get_inner_mat(self, size): def __add_outer_bevel(self, image, expand=True): if expand: image = ImageOps.expand(image, 5) - outer_bevel_image = self.__9patch_bevel.render(image.width, image.height) + outer_bevel_image = self.__9patch_bevel.render(image.width, image.height, Image.Resampling.LANCZOS) image.paste(outer_bevel_image, (0, 0), outer_bevel_image) return image def __add_inner_shadow(self, image): - inner_shadow_image = self.__9patch_inner_shadow.render(image.width, image.height) + inner_shadow_image = self.__9patch_inner_shadow.render(image.width, image.height, Image.Resampling.LANCZOS) image.paste(inner_shadow_image, (0, 0), inner_shadow_image) return image @@ -362,7 +362,7 @@ def __add_image_outline(self, img, mat_base_color, outline_width=1, auto_adjust= def __add_drop_shadow(self, image): shadow_offset = 15 mod_image = Image.new('RGBA', (image.width + shadow_offset, image.height + shadow_offset), (0, 0, 0, 0)) - shadow_image = self.__9patch_drop_shadow.render(mod_image.width, mod_image.height) + shadow_image = self.__9patch_drop_shadow.render(mod_image.width, mod_image.height, Image.Resampling.LANCZOS) mod_image.paste(shadow_image, (0, 0), shadow_image) mod_image.paste(image, (0, 0)) return mod_image