From: Guillaume Pellerin Date: Tue, 15 Jul 2014 08:50:37 +0000 (+0200) Subject: Merge branch 'parameters_with_traits' into diadems X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d535ceb0c18aebabce16233654d98d4e75abda93;p=timeside.git Merge branch 'parameters_with_traits' into diadems Conflicts: setup.py timeside/grapher/render_analyzers.py timeside/server/models.py --- d535ceb0c18aebabce16233654d98d4e75abda93 diff --cc setup.py index 595f539,1077787..12b2fc4 --- a/setup.py +++ b/setup.py @@@ -58,9 -58,8 +58,10 @@@ setup 'django-extensions', 'djangorestframework', 'south', - 'traits' + 'py_sonicvisualiser', ++ 'traits', ], + platforms=['OS Independent'], license='Gnu Public License V2', classifiers = CLASSIFIERS, diff --cc timeside/grapher/render_analyzers.py index 3ba9414,f976207..79539f3 --- a/timeside/grapher/render_analyzers.py +++ b/timeside/grapher/render_analyzers.py @@@ -53,27 -53,14 +53,27 @@@ class DisplayAnalyzer(Grapher) @interfacedoc def post_process(self): - - parent_result = self.process_pipe.results[self._result_id] + pipe_result = self.process_pipe.results + parent_result = pipe_result.get_result_by_id(self._result_id) - self.image = parent_result._render_PIL((self.image_width, - self.image_height), self.dpi) + fg_image = parent_result._render_PIL((self.image_width, + self.image_height), self.dpi) + if self._background: + bg_result = self.process_pipe.results[self._bg_id] + bg_image = bg_result._render_PIL((self.image_width, + self.image_height), self.dpi) + # convert image to grayscale + bg_image = bg_image.convert('LA').convert('RGBA') + + # Merge background and foreground images + from PIL.Image import blend + fg_image = blend(fg_image, bg_image, 0.25) + + self.image = fg_image @classmethod - def create(cls, analyzer, result_id, grapher_id, grapher_name): + def create(cls, analyzer, result_id, grapher_id, grapher_name, + background=None): class NewGrapher(cls):