Originally Posted by
steeldriver
You could also maybe take a look at opencv
+1
Code:
sudo apt-get install libcv2.3 python-opencv python-numpy
A simple example (creates a 100x100 PNG file with a single 10x100 gray stripe at the top:
Code:
#!/urs/bin/env python
import cv
width = 100
height = 100
bit_depth = 8
channels = 3
image = cv.CreateImage((width, height), bit_depth, channels)
color = cv.RGB(127, 127, 127)
start = (0, 0)
end = (99, 9)
cv.Rectangle(image, start, end, color, -1)
cv.SaveImage("test.png", image)
Colors and start/end coordinates can be stored in lists of tuples. Then you can iterate over those lists in a for loop. For more info about python-opencv, see the reference guide.
Bookmarks