Fredrik Lundh wrote:
> Chaos wrote:
>
> > I have tried PIL. Not only that, but the Image.eval function had no
> > success either. I did some tests and I found out that Image.eval only
> > called the function a certain number of times either 250, or 255.
> > Unless I can find a working example for
Chaos wrote:
> I have tried PIL. Not only that, but the Image.eval function had no
> success either. I did some tests and I found out that Image.eval only
> called the function a certain number of times either 250, or 255.
> Unless I can find a working example for this function, its impossible
> t
Paul McGuire wrote:
> "Chaos" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > Paul McGuire wrote:
> > > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > "Chaos" <[EMAIL PROTECTED]> wrote in message
> > > > news:[EMAIL PROTECTED]
> > > >
"Chaos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> Paul McGuire wrote:
> > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > "Chaos" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > >
> > > >
> > > > myCol = (0.3 * image
Chaos wrote:
> nikie wrote:
> > Chaos wrote:
> >
> > > As my first attempt to loop through every pixel of an image, I used
> > >
> > > for thisY in range(0, thisHeight):
> > > for thisX in range(0, thisWidth):
> > > #Actions here for Pixel thisX, thisY
> > >
>
Paul McGuire wrote:
> "Paul McGuire" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > "Chaos" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > >
> > >
> > > myCol = (0.3 * image.GetRed(thisX, thisY)) + (0.59 *
> > > image.GetGreen(thisX, thisY)) + (0.11 * image.
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Chaos" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> >
> > myCol = (0.3 * image.GetRed(thisX, thisY)) + (0.59 *
> > image.GetGreen(thisX, thisY)) + (0.11 * image.GetBlue(thisX, thisY))
> > if myCol <
Chaos wrote:
> As my first attempt to loop through every pixel of an image, I used
>
> for thisY in range(0, thisHeight):
> for thisX in range(0, thisWidth):
> #Actions here for Pixel thisX, thisY
>
> But it takes 450-1000 milliseconds
>
> I want speeds less
nikie wrote:
> Chaos wrote:
>
> > As my first attempt to loop through every pixel of an image, I used
> >
> > for thisY in range(0, thisHeight):
> > for thisX in range(0, thisWidth):
> > #Actions here for Pixel thisX, thisY
> >
> > But it takes 450-1000 millis
nikie wrote:
> Chaos wrote:
>
> > As my first attempt to loop through every pixel of an image, I used
> >
> > for thisY in range(0, thisHeight):
> > for thisX in range(0, thisWidth):
> > #Actions here for Pixel thisX, thisY
> >
> > But it takes 450-1000 millis
Chaos wrote:
> As my first attempt to loop through every pixel of an image, I used
>
> for thisY in range(0, thisHeight):
> for thisX in range(0, thisWidth):
> #Actions here for Pixel thisX, thisY
>
> But it takes 450-1000 milliseconds
>
> I want speeds less t
Terry Reedy wrote:
> "Chaos" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >> > As my first attempt to loop through every pixel of an image, I used
> >> >
> >> > for thisY in range(0, thisHeight):
> >> > for thisX in range(0, thisWidth):
> >> >
"Chaos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>> > As my first attempt to loop through every pixel of an image, I used
>> >
>> > for thisY in range(0, thisHeight):
>> > for thisX in range(0, thisWidth):
>> > #Actions here for Pixel thisX
Chaos wrote:
> As my first attempt to loop through every pixel of an image, I used
>
> for thisY in range(0, thisHeight):
> for thisX in range(0, thisWidth):
> #Actions here for Pixel thisX, thisY
>
> But it takes 450-1000 milliseconds
>
> I want speeds less th
"Paul McGuire" <[EMAIL PROTECTED]> wrote:
| "H J van Rooyen" <[EMAIL PROTECTED]> wrote in message
| news:[EMAIL PROTECTED]
| > "Paul McGuire" <[EMAIL PROTECTED]> wrote:
| >
| > | Even downer-and-dirtier, you could approximate 30 with 32, 59 with 64,
| and
| > | 11 with 8, and do bit-shifting ins
Chaos ([EMAIL PROTECTED]) wrote:
: He is the code #Actions here
: myCol = (0.3 * image.GetRed(thisX, thisY)) + (0.59 *
: image.GetGreen(thisX, thisY)) + (0.11 * image.GetBlue(thisX, thisY))
: if myCol < darkestCol:
:darkestCol = myCol
:possX = thisX
:possY = thisY
You really don't wa
Chaos wrote:
> As my first attempt to loop through every pixel of an image, I used
>
> for thisY in range(0, thisHeight):
> for thisX in range(0, thisWidth):
> #Actions here for Pixel thisX, thisY
>
> But it takes 450-1000 milliseconds
>
> I want speeds less th
"H J van Rooyen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Paul McGuire" <[EMAIL PROTECTED]> wrote:
>
> | Even downer-and-dirtier, you could approximate 30 with 32, 59 with 64,
and
> | 11 with 8, and do bit-shifting instead of multiplying:
> |
> | def darkness(img,x,y):
> |
Simon Forman wrote:
> Chaos wrote:
> > Simon Forman wrote:
> > > Chaos wrote:
> > > > As my first attempt to loop through every pixel of an image, I used
> > > >
> > > > for thisY in range(0, thisHeight):
> > > > for thisX in range(0, thisWidth):
> > > > #Actio
"Paul McGuire" <[EMAIL PROTECTED]> wrote:
| Even downer-and-dirtier, you could approximate 30 with 32, 59 with 64, and
| 11 with 8, and do bit-shifting instead of multiplying:
|
| def darkness(img,x,y):
| return (RedVal(img,x,y) << 5) + (GreenVal(img,x,y) << 6) +
| (BlueVal(img,x,y) << 3)
|
|
Chaos wrote:
> Simon Forman wrote:
> > Chaos wrote:
> > > As my first attempt to loop through every pixel of an image, I used
> > >
> > > for thisY in range(0, thisHeight):
> > > for thisX in range(0, thisWidth):
> > > #Actions here for Pixel thisX, thisY
> > >
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello Chaos,
>
> Then of course if you do the whole thing many times you could just
> pre-generate the indices as in:
> all_indices=[]
> for i in xrange(thisHeight):
> for j in xrange(thisWidth):
> all_indices.a
"Chaos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> myCol = (0.3 * image.GetRed(thisX, thisY)) + (0.59 *
> image.GetGreen(thisX, thisY)) + (0.11 * image.GetBlue(thisX, thisY))
> if myCol < darkestCol:
>darkestCol = myCol
>possX = thisX
>possY = thisY
>
Psyco may b
Simon Forman wrote:
> Chaos wrote:
> > As my first attempt to loop through every pixel of an image, I used
> >
> > for thisY in range(0, thisHeight):
> > for thisX in range(0, thisWidth):
> > #Actions here for Pixel thisX, thisY
> >
> > But it takes 450-1000 m
Have you tried PIL? (Python Imaging Library)
"Chaos" <[EMAIL PROTECTED]> wrote:
>As my first attempt to loop through every pixel of an image, I used
>
>for thisY in range(0, thisHeight):
>for thisX in range(0, thisWidth):
> #Actions here for Pixel thisX, thisY
Chaos wrote:
> As my first attempt to loop through every pixel of an image, I used
>
> for thisY in range(0, thisHeight):
> for thisX in range(0, thisWidth):
> #Actions here for Pixel thisX, thisY
>
> But it takes 450-1000 milliseconds
>
> I want speeds less th
Chaos wrote:
> John Machin wrote:
> > Chaos wrote:
> > > As my first attempt to loop through every pixel of an image, I used
> > >
> > > for thisY in range(0, thisHeight):
> > > for thisX in range(0, thisWidth):
> > > #Actions here for Pixel thisX, thisY
> >
>
Hello Chaos,
Whatever you do in "#Actions here ..." might be expressed nicely as a
ufunction for numeric. Then you might be able to convert the expression
to a numeric expression. Check out numpy/scipy.
In general, if thisHeight, thisWidth are large use xrange not range.
range() generates a list
John Machin wrote:
> Chaos wrote:
> > As my first attempt to loop through every pixel of an image, I used
> >
> > for thisY in range(0, thisHeight):
> > for thisX in range(0, thisWidth):
> > #Actions here for Pixel thisX, thisY
>
> OT: you don't need the 0 in
Chaos wrote:
> As my first attempt to loop through every pixel of an image, I used
>
> for thisY in range(0, thisHeight):
> for thisX in range(0, thisWidth):
> #Actions here for Pixel thisX, thisY
OT: you don't need the 0 in the range call. Taking it out does
30 matches
Mail list logo