summaryrefslogtreecommitdiff
path: root/addons/web/models/base_document_layout.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web/models/base_document_layout.py')
-rw-r--r--addons/web/models/base_document_layout.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/models/base_document_layout.py b/addons/web/models/base_document_layout.py
index 6dd2883f3b9..3396e0db805 100644
--- a/addons/web/models/base_document_layout.py
+++ b/addons/web/models/base_document_layout.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+from PIL import Image
from odoo import api, fields, models, tools
@@ -181,7 +182,7 @@ class BaseDocumentLayout(models.TransientModel):
# Converts to RGBA (if already RGBA, this is a noop)
image_converted = image.convert('RGBA')
- image_resized = image_converted.resize((w, h))
+ image_resized = image_converted.resize((w, h), resample=Image.NEAREST)
colors = []
for color in image_resized.getcolors(w * h):