Skip to content

Commit

Permalink
Updated Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cleure committed Jun 15, 2014
1 parent e9c000f commit 99d44fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
9 changes: 3 additions & 6 deletions README.md
Expand Up @@ -56,17 +56,14 @@ Generate HSV Color Pattern:
from imagekit import *

def main():
b = ImageBuffer(640, 480, 3)
b.to_hsv()
h_scale = 360.0 / b.width
b = ImageBuffer(640, 480, 3, 360.0, COLORSPACE_HSV, COLORSPACE_FORMAT_HSV_NATURAL)
hue_scale = 360.0 / b.width
for y in range(b.height):
for x in range(b.width):
b.set_pixel(x, y, (x * h_scale, 1.0, 1.0))
b.set_pixel(x, y, (x * hue_scale, 1.0, 1.0))

b.save_png('example5-output.png')

if __name__ == '__main__':
main()

8 changes: 3 additions & 5 deletions example5.py
Expand Up @@ -3,14 +3,12 @@
from imagekit import *

def main():
b = ImageBuffer(640, 480, 3)
b.to_hsv()

h_scale = 360.0 / b.width
b = ImageBuffer(640, 480, 3, 360.0, COLORSPACE_HSV, COLORSPACE_FORMAT_HSV_NATURAL)

hue_scale = 360.0 / b.width
for y in range(b.height):
for x in range(b.width):
b.set_pixel(x, y, (x * h_scale, 1.0, 1.0))
b.set_pixel(x, y, (x * hue_scale, 1.0, 1.0))

b.save_png('example5-output.png')

Expand Down

0 comments on commit 99d44fd

Please sign in to comment.