diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-11-03 06:20:05 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2007-11-03 06:20:05 (GMT) |
commit | f34232651c46fe12ab21645ee799814d4f99af8b (patch) | |
tree | 939459f67952433a9a4ab46b874f98dee1399d8f /utils.py | |
parent | 84ad60151ed011458254cd579c37a5d2fadafb35 (diff) |
new grayscale
working mesh code
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@860 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -91,7 +91,7 @@ def getDateString( when ): return strftime( "%a, %b %d, %I:%M:%S %p", time.localtime(when) ) -def grayScalePixBuf( pb, copy ): +def grayScalePixBuf2( pb, copy ): arr = pb.get_pixels_array() if (copy): arr = arr.copy() @@ -101,4 +101,10 @@ def grayScalePixBuf( pb, copy ): pxl[0][0] = y pxl[1][0] = y pxl[2][0] = y - return gtk.gdk.pixbuf_new_from_array(arr, pb.get_colorspace(), pb.get_bits_per_sample())
\ No newline at end of file + return gtk.gdk.pixbuf_new_from_array(arr, pb.get_colorspace(), pb.get_bits_per_sample()) + + +def grayScalePixBuf( pb, copy ): + pb2 = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, pb.get_width(), pb.get_height()) + pb.saturate_and_pixelate(pb2, 0, 0) + return pb2
\ No newline at end of file |