On 03/06/2013 06:46 PM, olsr.ka...@gmail.com wrote:
how can i draw a line if the point of the begining and the end if those points are différent from the white in other exepretion how can i get the color of two points of the begining and the end????? please help me!!!!
This should get you going. If it doesn't work it will still direct you to the relevant chapters in the tutorial. Frederic def draw_line (image): # image is a PIL Image ( <class Image.Image at ...> ) # Define your colors WHITE = ~0 # Probably white for all modes. LINE_COLOR = 0 # define # Find end points points = [] pixels = image.load () # Fast pixel access for y in range (image.size [1]): for x in range (image.size [0]): if pixels [x, y] != WHITE points.append ((x, y)) # Join end points draw = ImageDraw.Draw (image) draw.line (points, fill = LINE_COLOR) -- http://mail.python.org/mailman/listinfo/python-list