Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Can I create an image with a specific level of transparency?

Reply
Thread Tools

Can I create an image with a specific level of transparency?

 
 
Kurda Yon
Guest
Posts: n/a
 
      10-11-2008
Hi,

to make a part of an image transparent I use the following commands:
imagecolortransparent($image, $color_1);

After that command all parts of an image, which are "colored" by
$color_1, will be transparent. It means that If I put such an image as
a table-background, I will see the page-background behind the
transparent parts of the image.

However, in the above way, I can create only absolutely transparent
"colors" and I would like to have "partially" transparent colors. I
tried to use

$color_1 = imagecolorallocatealpha($image, 255, 0, 0, 60);

In theory it should create the red color with the level of
transparancy equal to 60. However, because of some reasons, it does
not work. I cannot see anything through this red color. Or to be more
precise, I can see some objects through this color ONLY if these
objects are part of the image. But image itself is not transparent.

Does anybody know how to overcome this problem and why it appears?

Thank you in advance.
 
Reply With Quote
 
 
 
 
cwdjrxyz
Guest
Posts: n/a
 
      10-11-2008
On Oct 11, 11:54*am, Kurda Yon <(E-Mail Removed)> wrote:
> Hi,
>
> to make a part of an image transparent I use the following commands:
> imagecolortransparent($image, $color_1);
>
> After that command all parts of an image, which are "colored" by
> $color_1, will be transparent. It means that If I put such an image as
> a table-background, I will see the page-background behind the
> transparent parts of the image.
>
> However, in the above way, I can create only absolutely transparent
> "colors" and I would like to have "partially" transparent colors. I
> tried to use
>
> $color_1 = imagecolorallocatealpha($image, 255, 0, 0, 60);
>
> In theory it should create the red color with the level of
> transparancy equal to 60. However, because of some reasons, it does
> not work. I cannot see anything through this red color. Or to be more
> precise, I can see some objects through this color ONLY if these
> objects are part of the image. But image itself is not transparent.
>
> Does anybody know how to overcome this problem and why it appears?


You can create a png with transparency, and, I think, some types of
partial transparency, using server side php with the gd extension. I
have made one color completely transparent, but I have not tried
partial transparency using gd. Either you can use a php include in
your code to do this, or you can generate and save an actual png to
download and store on your computer and used as usual for an image on
web pages..

 
Reply With Quote
 
 
 
 
Kurda Yon
Guest
Posts: n/a
 
      10-11-2008
On Oct 11, 4:05 pm, cwdjrxyz <(E-Mail Removed)> wrote:
> On Oct 11, 11:54 am, Kurda Yon <(E-Mail Removed)> wrote:
>
>
>
> > Hi,

>
> > to make a part of an image transparent I use the following commands:
> > imagecolortransparent($image, $color_1);

>
> > After that command all parts of an image, which are "colored" by
> > $color_1, will be transparent. It means that If I put such an image as
> > a table-background, I will see the page-background behind the
> > transparent parts of the image.

>
> > However, in the above way, I can create only absolutely transparent
> > "colors" and I would like to have "partially" transparent colors. I
> > tried to use

>
> > $color_1 = imagecolorallocatealpha($image, 255, 0, 0, 60);

>
> > In theory it should create the red color with the level of
> > transparancy equal to 60. However, because of some reasons, it does
> > not work. I cannot see anything through this red color. Or to be more
> > precise, I can see some objects through this color ONLY if these
> > objects are part of the image. But image itself is not transparent.

>
> > Does anybody know how to overcome this problem and why it appears?

>
> You can create a png with transparency, and, I think, some types of
> partial transparency, using server side php with the gd extension. I
> have made one color completely transparent, but I have not tried
> partial transparency using gd. Either you can use a php include in
> your code to do this, or you can generate and save an actual png to
> download and store on your computer and used as usual for an image on
> web pages..


I use dg and I was able to create completely transparent image. But I
have problems with partially transparent image. I could create a
partial transparent objects (for example ellipses), such that I could
see other objects trough them. But the whole image itself is not
transparent...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to rotate image so that image is perfectly level bucky3 Digital Photography 11 07-15-2009 08:59 AM
c is a low-level language or neither low level nor high level language pabbu C Programming 8 11-07-2005 03:05 PM
Is Cisco PIX Application level firewall or Packet level firewall? Learning Cisco Cisco 3 10-15-2005 12:55 AM
Accessing higher security level from higher security level nderose@gmail.com Cisco 0 07-11-2005 10:20 PM
Page Level and Applicatoin Level Custom Errors rranveer@gmail.com ASP .Net 2 02-13-2005 02:03 AM



Advertisments