'django-extensions',
'djangorestframework',
'south',
- 'traits'
+ 'py_sonicvisualiser',
++ 'traits',
],
+
platforms=['OS Independent'],
license='Gnu Public License V2',
classifiers = CLASSIFIERS,
@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):