idiolect wrote:
> On Jun 25, 7:26 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
>> idiolect wrote:
>> > Hi all - Sorry to plague you with another newbie question from a
>> > lurker. Hopefully, this will be simple.
>>
>> > I have a list full of RGB pixel values read from an image. I want to
>> > tes
On Wed, 25 Jun 2008 16:02:52 -0700, John Machin wrote:
> Here's one approach (requires Python 2.5 or later):
> [(50 if x < 50 else x, 50 if y < 50 else y, 50 if z < 50 else z) for
> (x, y, z) in source]
[(max(x, 50), max(y, 50), max(z, 50)) for (x, y, z) in source]
--
09 F9 11 02 9D 74 E3 5B D8
On Jun 25, 7:26 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> idiolect wrote:
> > Hi all - Sorry to plague you with another newbie question from a
> > lurker. Hopefully, this will be simple.
>
> > I have a list full of RGB pixel values read from an image. I want to
> > test each RGB band value per
idiolect wrote:
Hi all - Sorry to plague you with another newbie question from a
lurker. Hopefully, this will be simple.
I have a list full of RGB pixel values read from an image. I want to
test each RGB band value per pixel, and set it to something else if it
meets or falls below a certain
First, I second Matt's comment about using a boring old for loop when
it is the simplest way to express what you want to do. Being Pythonic
is not about using exotic features to scrunch your code down to a cool
one-liner. It is about expressing your intentions in a simple, direct
way. Sometimes
On Jun 26, 7:37 am, idiolect <[EMAIL PROTECTED]> wrote:
> Hi all - Sorry to plague you with another newbie question from a
> lurker. Hopefully, this will be simple.
>
> I have a list full of RGB pixel values read from an image. I want to
> test each RGB band value per pixel, and set it to somethi
On Jun 25, 2:37 pm, idiolect <[EMAIL PROTECTED]> wrote:
> Hi all - Sorry to plague you with another newbie question from a
> lurker. Hopefully, this will be simple.
>
> I have a list full of RGB pixel values read from an image. I want to
> test each RGB band value per pixel, and set it to somethi
Hi all - Sorry to plague you with another newbie question from a
lurker. Hopefully, this will be simple.
I have a list full of RGB pixel values read from an image. I want to
test each RGB band value per pixel, and set it to something else if it
meets or falls below a certain threshold - i.e., a