From 3e9a578c077b088e4cb5454f7b151317aea7f8ec Mon Sep 17 00:00:00 2001 From: nediamond Date: Thu, 29 Jun 2017 19:43:32 -0400 Subject: [PATCH] Update ImageDraw.py --- PIL/ImageDraw.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PIL/ImageDraw.py b/PIL/ImageDraw.py index fd09e86c3..ee0405fab 100644 --- a/PIL/ImageDraw.py +++ b/PIL/ImageDraw.py @@ -374,6 +374,6 @@ def floodfill(image, xy, value, border=None, thresh=0): def _color_diff(rgb1, rgb2): """ - Uses distance formula to calculate difference between two rgb values. + Uses 1-norm distance to calculate difference between two rgb values. """ - return ((rgb1[0]-rgb2[0])**2 + (rgb1[1]-rgb2[1])**2 + (rgb1[2]-rgb2[2])**2)**.5 + return abs(rgb1[0]-rgb2[0]) + abs(rgb1[1]-rgb2[1]) + abs(rgb1[2]-rgb2[2])