self.pixel = self.image.load()
self.draw = ImageDraw.Draw(self.image)
+ def render(self, output=None):
+ if output:
+ self.image.save(output)
+ return
+ return self.image
+
def watermark(self, text, font=None, color=(255, 255, 255), opacity=.6, margin=(5,5)):
self.image = im_watermark(text, text, color=color, opacity=opacity, margin=margin)
self.previous_x, self.previous_y = x, y
+
if __name__ == "__main__":
import doctest
doctest.testmod()
\ No newline at end of file
self.pixel_cursor += 1
return frames, eod
- def render(self, filename):
- """ Apply last 2D transforms and write all pixels to the file. """
+ @interfacedoc
+ def post_process(self):
+ """ Apply last 2D transforms"""
self.image.putdata(self.pixels)
- self.image.transpose(Image.ROTATE_90).save(filename)
+ self.image.transpose(Image.ROTATE_90)
+
return frames, eod
@interfacedoc
- def render(self, output):
- if output:
- a = 1
- for x in range(self.image_width):
- self.pixel[x, self.image_height/2] = tuple(map(lambda p: p+a, self.pixel[x, self.image_height/2]))
- self.image.save(output)
- return self.image
+ def post_process(self, output=None):
+ a = 1
+ for x in range(self.image_width):
+ self.pixel[x, self.image_height/2] = tuple(map(lambda p: p+a, self.pixel[x, self.image_height/2]))
+
self.draw_peaks_inverted(self.pixel_cursor, peaks(samples), self.line_color)
self.pixel_cursor += 1
return frames, eod
-
- @interfacedoc
- def render(self, output):
- if output:
- a = 1
- for x in range(self.image_width):
- self.pixel[x, self.image_height/2] = tuple(map(lambda p: p+a, self.pixel[x, self.image_height/2]))
- self.image.save(output)
- return self.image