Image.ANTIALIAS->Image.LANCZOS

This commit is contained in:
j 2023-08-25 00:18:57 +02:00
parent 657a1dd234
commit 8fa66491fe

View file

@ -213,10 +213,10 @@ class Timelines():
paste = (large_tile_x, 0) paste = (large_tile_x, 0)
# render antialias tile # render antialias tile
self.log and self.profiler.set_task('i.resize((1, h), Image.ANTIALIAS) # antialias timelines') self.log and self.profiler.set_task('i.resize((1, h), Image.LANCZOS) # antialias timelines')
if self.render_antialias or self.render_cuts: if self.render_antialias or self.render_cuts:
resize = (1, self.large_tile_h) resize = (1, self.large_tile_h)
antialias_image = frame_image.resize(resize, Image.ANTIALIAS) antialias_image = frame_image.resize(resize, Image.LANCZOS)
if self.render_antialias: if self.render_antialias:
self.large_tile_image['antialias'].paste(antialias_image, paste) self.large_tile_image['antialias'].paste(antialias_image, paste)
@ -234,8 +234,8 @@ class Timelines():
# render data tile # render data tile
if self.render_data or self.detect_cuts: if self.render_data or self.detect_cuts:
self.log and self.profiler.set_task('i.resize((8, 8), Image.ANTIALIAS) # cut detection') self.log and self.profiler.set_task('i.resize((8, 8), Image.LANCZOS) # cut detection')
data_image = frame_image.resize((8, 8), Image.ANTIALIAS) data_image = frame_image.resize((8, 8), Image.LANCZOS)
if self.render_data: if self.render_data:
self.large_tile_image['data'].paste(data_image, (large_tile_x * 8, 0)) self.large_tile_image['data'].paste(data_image, (large_tile_x * 8, 0))
self.log and self.profiler.unset_task() self.log and self.profiler.unset_task()
@ -315,7 +315,7 @@ class Timelines():
if mode == 'keyframeswide': if mode == 'keyframeswide':
resize = (self.wide_frame_w, self.large_tile_h) resize = (self.wide_frame_w, self.large_tile_h)
self.log and self.profiler.set_task('i,resize((w, h)) # keyframeswide timelines') self.log and self.profiler.set_task('i,resize((w, h)) # keyframeswide timelines')
frame_image = frame_image.resize(resize, Image.ANTIALIAS) frame_image = frame_image.resize(resize, Image.LANCZOS)
self.log and self.profiler.unset_task() self.log and self.profiler.unset_task()
left = int((self.frame_w * wide - image_w) / 2) left = int((self.frame_w * wide - image_w) / 2)
crop = (left, 0, left + image_w, self.large_tile_h) crop = (left, 0, left + image_w, self.large_tile_h)
@ -423,7 +423,7 @@ class Timelines():
if self.full_tile_widths[0] > 0 and self.large_tile_h > 0: if self.full_tile_widths[0] > 0 and self.large_tile_h > 0:
resized = self.large_tile_image[mode].resize(( resized = self.large_tile_image[mode].resize((
self.full_tile_widths[0], self.large_tile_h self.full_tile_widths[0], self.large_tile_h
), Image.ANTIALIAS) ), Image.LANCZOS)
self.full_tile_image.paste(resized, (self.full_tile_offset, 0)) self.full_tile_image.paste(resized, (self.full_tile_offset, 0))
self.full_tile_offset += self.full_tile_widths[0] self.full_tile_offset += self.full_tile_widths[0]
self.full_tile_widths = self.full_tile_widths[1:] self.full_tile_widths = self.full_tile_widths[1:]
@ -438,7 +438,7 @@ class Timelines():
print(tile_file) print(tile_file)
if self.render_small_tiles: if self.render_small_tiles:
resize = (self.full_tile_w, self.small_tile_h) resize = (self.full_tile_w, self.small_tile_h)
self.full_tile_image = self.full_tile_image.resize(resize, Image.ANTIALIAS) self.full_tile_image = self.full_tile_image.resize(resize, Image.LANCZOS)
tile_file = '%stimeline%s%dp.jpg' % ( tile_file = '%stimeline%s%dp.jpg' % (
self.tile_path, mode, self.small_tile_h self.tile_path, mode, self.small_tile_h
) )
@ -490,7 +490,7 @@ class Timelines():
else: else:
w = self.small_tile_last_w % 60 or 60 w = self.small_tile_last_w % 60 or 60
resize = (w, self.small_tile_h) resize = (w, self.small_tile_h)
resized = self.large_tile_image[mode].resize(resize, Image.ANTIALIAS) resized = self.large_tile_image[mode].resize(resize, Image.LANCZOS)
paste = (small_tile_x, 0) paste = (small_tile_x, 0)
self.small_tile_image[small_mode].paste(resized, paste) self.small_tile_image[small_mode].paste(resized, paste)
# save small tile # save small tile