[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

PIL transparency gradient

adder

3/1/2008 9:05:00 PM

I would like to create a transparency gradient over an image using
PIL. But I don't have a clue how to do this...
Is there anyone out here who could give me some advise?
31 Answers

spe.stani.be

3/1/2008 9:38:00 PM

0

On 1 mrt, 22:04, Allard Warrink <allardwarr...@gmail.com> wrote:
> I would like to create a transparency gradient over an image using
> PIL. But I don't have a clue how to do this...
> Is there anyone out here who could give me some advise?

Phatch (PHoto & bATCH) is an application based on PIL. Its actions
contain many useful PIL recipes, such as applying a transparency
gradient to an image. You basically need to create an 1pxx256px
grayscale image which goes from 0 to 255. After that you can stretch
it to the image size and add it as an alpha channel. You'll find the
source code for this in the phatch/actions/mask.py Every action
contains a 'raw' PIL function that can work independently outside the
context of Phatch. This is by design, inspired by the MVC model in
which you could see PIL as the model and Phatch as the View.

You can get Phatch at:
http://photobatc...

Read first *carefully* the installation instructions for your
platform:
http://photobatch.wikidot.c...

Stani

adder

3/1/2008 11:18:00 PM

0

Thanks for the inspiration!
This what I did (Using your Python Editor (SPE), I really like to work
with SPE, keep up the good work!!):

#############################################
import Image, os
p = # path to image file

im = Image.open(p)
# check if im has Alpha band...
if im.mode != 'RGBA':
im = im.convert('RGBA')
# create a vertical gradient...
gradient = Image.new('L', (1,255))
for y in range(255):
gradient.putpixel((0,254-y),y)
# resize the gradient to the size of im...
alpha = gradient.resize(im.size)
# put alpha in the alpha band of im...
im.putalpha(alpha)
# Save as png...
im.save(os.path.splitext(p)[0] + '.png', 'PNG

#############################################

henri

4/1/2008 8:47:00 PM

0

On Tue, 01 Apr 2008 15:05:54 -0500, anon711z <anon@anon.anon> wrote:

BAAAAAAAAW deleted.

Since you don't want to be there anyway you should be thanking me for
helping you depart.

You're welcome.

Here's a tissue.

Ball of Fluff

4/2/2008 2:22:00 AM

0



"anon711z" <anon@anon.anon> wrote in message
news:65fit3F2ffai0U1@mid.individual.net...
> Ball of Fluff wrote:
>> "anon711z" <anon@anon.anon> wrote in message
>> news:65dk5fF2dq7n3U1@mid.individual.net...
>>
>>>WTF?
>>>
>>>What are they hiding?
>>>
>>>A surly group for sure...and I didn't say a thing.
>>>
>>>Seem butt hurt by the other critics WTF? Some scifag named "danton"
>>
>>
>> Seems to me that if you're posting about this and you want people to
>> explain it to you, you MIGHT want to include some DETAILS.
>
> details? ok
>
> <dst_work> luke skywalker was played by Mark Hamill, who is incredibyl
> effeminate in real lfie
> <dst_work> life
> <Danton> luke skywalker was ALWAYS a girly girl kind of hero
> <dst_work> he had long hair but he didn't swish
> <barbz> crikey, wtev
> <tanya_> still, I would like a shot of him kissing dm
> <barbz> point is, the scn battle mirrors the fight against teh Evil Empire
> <dst_work> "Bride of Xenu" is going to be her name for a while
> <barbz> heh, yup
> <dst_work> She should star in the Scientology Christmas pageant
> <barbz> I gotta go hook up te other comp system
> <barbz> so cya later
> * barbz has quit IRC (Read error: EOF from client)
> * Danton sets mode: +b *!*@213.141.156.56
> * You were kicked by Danton (come back and chat some time)
> Session Close: Mon Mar 31 20:53:12 2008
>
> when the topic went to rw homoizm i went off to look at something
> interesting. they say they want me to chat...what are then going to ask?
> what is my real name? what's my address? do i think the "force" is
> faggoty?
>
> nobody complained. nobody asked me anything.
>
> i went there to try to understand the cult and it's critics. i found
> circle jerkz self absorbed then i was kicked... lulz
>

Thought you got kicked cuz your nick/id whatever the fuck (you young people
with your lulz and your motorcars an' elektricitee!) was inactive.

I don't see any censorship in the above. I don't see that you were saying
things that caused people to freak out and get all pissed off.

In fact, I don't see that you were saying anything.

Not exactly a brilliant example of censorship and violation of that nifty
kewl 1st amendment thingie.

C

www.claireswazey.com


John Smith

4/2/2008 2:34:00 AM

0

henri wrote:

> On Tue, 01 Apr 2008 15:05:54 -0500, anon711z <anon@anon.anon> wrote:
>
> BAAAAAAAAW deleted.
>
> Since you don't want to be there anyway you should be thanking me for
> helping you depart.
>
> You're welcome.
>
> Here's a tissue.

fail elderly jagoff

Brian

4/2/2008 2:37:00 AM

0


"Ball of Fluff" <getoffmyass@fluffentology.com> wrote in message
news:47f2eddb$1@news2.lightlink.com...
>
>
> "anon711z" <anon@anon.anon> wrote in message
> news:65fit3F2ffai0U1@mid.individual.net...
>> Ball of Fluff wrote:
>>> "anon711z" <anon@anon.anon> wrote in message
>>> news:65dk5fF2dq7n3U1@mid.individual.net...
>>>
>>>>WTF?
>>>>
>>>>What are they hiding?
>>>>
>>>>A surly group for sure...and I didn't say a thing.
>>>>
>>>>Seem butt hurt by the other critics WTF? Some scifag named "danton"
>>>
>>>
>>> Seems to me that if you're posting about this and you want people to
>>> explain it to you, you MIGHT want to include some DETAILS.
>>
>> details? ok
>>
>> <dst_work> luke skywalker was played by Mark Hamill, who is incredibyl
>> effeminate in real lfie
>> <dst_work> life
>> <Danton> luke skywalker was ALWAYS a girly girl kind of hero
>> <dst_work> he had long hair but he didn't swish
>> <barbz> crikey, wtev
>> <tanya_> still, I would like a shot of him kissing dm
>> <barbz> point is, the scn battle mirrors the fight against teh Evil
>> Empire
>> <dst_work> "Bride of Xenu" is going to be her name for a while
>> <barbz> heh, yup
>> <dst_work> She should star in the Scientology Christmas pageant
>> <barbz> I gotta go hook up te other comp system
>> <barbz> so cya later
>> * barbz has quit IRC (Read error: EOF from client)
>> * Danton sets mode: +b *!*@213.141.156.56
>> * You were kicked by Danton (come back and chat some time)
>> Session Close: Mon Mar 31 20:53:12 2008
>>
>> when the topic went to rw homoizm i went off to look at something
>> interesting. they say they want me to chat...what are then going to ask?
>> what is my real name? what's my address? do i think the "force" is
>> faggoty?
>>
>> nobody complained. nobody asked me anything.
>>
>> i went there to try to understand the cult and it's critics. i found
>> circle jerkz self absorbed then i was kicked... lulz
>>
>
> Thought you got kicked cuz your nick/id whatever the fuck (you young
> people with your lulz and your motorcars an' elektricitee!) was inactive.
>
> I don't see any censorship in the above. I don't see that you were saying
> things that caused people to freak out and get all pissed off.
>
> In fact, I don't see that you were saying anything.
>
> Not exactly a brilliant example of censorship and violation of that nifty
> kewl 1st amendment thingie.

Freedom of Assembly is part of the 1st amendment. It does not necessarily
involves saying anything.



Ball of Fluff

4/2/2008 4:11:00 AM

0



"anon711z" <anon@anon.anon> wrote in message
news:65g9k7F2g3ufsU1@mid.individual.net...
> henri wrote:
>
>> On Tue, 01 Apr 2008 15:05:54 -0500, anon711z <anon@anon.anon> wrote:
>>
>> BAAAAAAAAW deleted.
>>
>> Since you don't want to be there anyway you should be thanking me for
>> helping you depart.
>>
>> You're welcome.
>>
>> Here's a tissue.
>
> fail elderly jagoff

Henri is neither of those things.

C

www.claireswazey.com


anothersurfer999

4/2/2008 4:55:00 AM

0

It's obviously a private chat group.

And they are apparently rather paranoid -- which is within their
rights. You might have been... duh-duh-duh-duh! OSA!!!!

EEEEEEEK!

Anyway -- why care?

And you can learn a lot about a group by how it treats -- Oooooo --
Outsiders!

Free speech is not guaranteed for privately-run enterprises. So it
goes,

They are well within their rights to kick anyone out. Just... learn
about that group based on your own experience. I know *I* have
learned something about that venue based on your story and the
responses to it here from those who are apparently its denizens.

Thanks for the report and the post of the chat taking place while. It
helps to see how lurkers are treated there (among other things).

Gives good insight into the folks who hang out there. :)

Another Surfer

Ball of Fluff

4/2/2008 1:38:00 PM

0



<anothersurfer999@hotmail.com> wrote in message
news:3ca26f91-3104-4efc-8071-3aadfb2b4cc7@s19g2000prg.googlegroups.com...
> It's obviously a private chat group.
>
> And they are apparently rather paranoid -- which is within their
> rights. You might have been... duh-duh-duh-duh! OSA!!!!
>
> EEEEEEEK!

Yeah, whereas the forums and chat rooms maintained by others never ever
mention OSA.

(gentle sarcasm)

>
> Anyway -- why care?
>
> And you can learn a lot about a group by how it treats -- Oooooo --
> Outsiders!

Wait a minute. All they did was kick off an inactive ID. There was no
"treatment" of anyone about it.

>
> Free speech is not guaranteed for privately-run enterprises. So it
> goes,

There wasn't ~any~ speech to guarantee, protest, go along with, kick off. It
was an inactive nick.

>
> They are well within their rights to kick anyone out. Just... learn
> about that group based on your own experience. I know *I* have
> learned something about that venue based on your story and the
> responses to it here from those who are apparently its denizens.

From what Henri says, it wasn't a question of kicking anyone out.


>
> Thanks for the report and the post of the chat taking place while. It
> helps to see how lurkers are treated there (among other things).

Would you like to know what happened when a friend of mine who is well known
in critical circles tried to join in and log into Lermanet? Banned for
abuse. The person had never done anything abusive on any forum, anywhere,
never been in CofS, none of that.

>
> Gives good insight into the folks who hang out there. :)

Gee, thanks a lot. I hang out there as do a number of very nice people of
whom I'm quite fond.

Personally, I think this thread is informative and indicates much about some
people- but not the ones to whom you allude here.

C

www.claireswazey.com


FTSOH

4/2/2008 2:25:00 PM

0

On Tue, 1 Apr 2008 19:36:58 -0700.
In the Newsgroup(s): alt.religion.scientology
With the Message-ID: <Sdednd216aTKbG_anZ2dnUVZ_jydnZ2d@supernews.com>
And the Organization Header: .
The famous author: "anon7571" <anon@anon.org>.
Wrote on the subject: Re: Kicked from #altreligionscientology:

>
>"Ball of Fluff" <getoffmyass@fluffentology.com> wrote in message
>news:47f2eddb$1@news2.lightlink.com...
>>
>>
>> "anon711z" <anon@anon.anon> wrote in message
>> news:65fit3F2ffai0U1@mid.individual.net...
>>> Ball of Fluff wrote:
>>>> "anon711z" <anon@anon.anon> wrote in message
>>>> news:65dk5fF2dq7n3U1@mid.individual.net...
>>>>
>>>>>WTF?
>>>>>
>>>>>What are they hiding?
>>>>>
>>>>>A surly group for sure...and I didn't say a thing.
>>>>>
>>>>>Seem butt hurt by the other critics WTF? Some scifag named "danton"
>>>>
>>>>
>>>> Seems to me that if you're posting about this and you want people to
>>>> explain it to you, you MIGHT want to include some DETAILS.
>>>
>>> details? ok
>>>
>>> <dst_work> luke skywalker was played by Mark Hamill, who is incredibyl
>>> effeminate in real lfie
>>> <dst_work> life
>>> <Danton> luke skywalker was ALWAYS a girly girl kind of hero
>>> <dst_work> he had long hair but he didn't swish
>>> <barbz> crikey, wtev
>>> <tanya_> still, I would like a shot of him kissing dm
>>> <barbz> point is, the scn battle mirrors the fight against teh Evil
>>> Empire
>>> <dst_work> "Bride of Xenu" is going to be her name for a while
>>> <barbz> heh, yup
>>> <dst_work> She should star in the Scientology Christmas pageant
>>> <barbz> I gotta go hook up te other comp system
>>> <barbz> so cya later
>>> * barbz has quit IRC (Read error: EOF from client)
>>> * Danton sets mode: +b *!*@213.141.156.56
>>> * You were kicked by Danton (come back and chat some time)
>>> Session Close: Mon Mar 31 20:53:12 2008
>>>
>>> when the topic went to rw homoizm i went off to look at something
>>> interesting. they say they want me to chat...what are then going to ask?
>>> what is my real name? what's my address? do i think the "force" is
>>> faggoty?
>>>
>>> nobody complained. nobody asked me anything.
>>>
>>> i went there to try to understand the cult and it's critics. i found
>>> circle jerkz self absorbed then i was kicked... lulz
>>>
>>
>> Thought you got kicked cuz your nick/id whatever the fuck (you young
>> people with your lulz and your motorcars an' elektricitee!) was inactive.
>>
>> I don't see any censorship in the above. I don't see that you were saying
>> things that caused people to freak out and get all pissed off.
>>
>> In fact, I don't see that you were saying anything.
>>
>> Not exactly a brilliant example of censorship and violation of that nifty
>> kewl 1st amendment thingie.
>
>Freedom of Assembly is part of the 1st amendment. It does not necessarily
>involves saying anything.
>
>

Duh..............

IRC and #altreligionscientology isn't covered by the U.S constitution or
any other constitution for that matter. IRC is not a U.S network, it's a
global network covering and emanating from countless countries world
wide.

Please oh Xenu answer me why so many U.S citizens believe that the
Internet is some American thingy only?

Please oh Xenu answer me why so many U.S citizens believe that they have
the best constitution and legal system on the entire planet, when they
are countless examples of the opposite?

Please oh Xenu, answer me....