[Tutor] Python Image library

elis aeris hunter92383 at gmail.com
Thu Jul 19 00:56:26 CEST 2007


that's illustrative.

On 7/19/07, Luke Paireepinart <rabidpoobear at gmail.com> wrote:
>
> Tiger12506 wrote:
> > You know the height and the width of the image, no?
> >
> > So you know that every 'width' number of pixels will start a new row.
> > So if you wanted say the fifth row down, second pixel, how would you
> find
> > it?
> >
> > The 1st line:  'width' number of pixels
> > The 2nd line: 'width' number of pixels
> > The 3rd line: 'width number of pixels
> > The 4th line: 'width' number of pixels
> > The 5th line: 2 pixels in from the left
> >
> > Add those up ~  width+width+width+width+2
> > Or  4*width+2
> >
> if you start counting at the 0th row and 0th column, this will give you
> the 4th row and 2nd column.
> if you're counting from the 1st row and 1st column, this will give you
> the 5th row and 3rd column.
> > That number is the index to use to get the pixel at coords (2,5)
> >
> So this is actually (3,5) or, to count from 0, (2,4).
> But yeah, the general idea is there.
> If my math is wrong I'm sure you won't hesitate to correct me ;)
> -Luke
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070719/286050dc/attachment.htm 


More information about the Tutor mailing list