diff --git a/ahb_raster_view.py b/ahb_raster_view.py index d135689..0738fbc 100644 --- a/ahb_raster_view.py +++ b/ahb_raster_view.py @@ -252,8 +252,9 @@ class RasterView: # Crop the image, which is also used to deduce the center of the source view original_size = composite_img.size - bg = Image.new(composite_img.mode, composite_img.size, '#ffffff') # fills an image with the background color - diff = ImageChops.difference(composite_img, bg) # diff between the actual image and the background color + diff_source_img = composite_img.split()[3] + bg = Image.new(diff_source_img.mode, diff_source_img.size, '#000000') # fills an image with the background color + diff = ImageChops.difference(diff_source_img, bg) # diff between the actual image and the background color bbox = diff.getbbox() # finds border size (non-black portion of the image) composite_img = composite_img.crop(bbox)