Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Jul 26, 2023
2 parents 3b25036 + b2562ce commit 67a3e3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ classifiers=[
]
dynamic = ["version"]
dependencies = [
"Pillow>=9.0.0",
"Pillow==9.5.0",
"defusedxml",
"pi3d>=2.49",
"PyYAML",
Expand Down
8 changes: 4 additions & 4 deletions src/picframe/mat_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 67a3e3f

Please sign in to comment.