Forum Moderators: coopster

Message Too Old, No Replies

Help with png format in php script!

         

NewDesigner

12:30 am on Mar 15, 2005 (gmt 0)

10+ Year Member



I have a countdown ticker script done in php on my site. The link to it is under my profile.

The images are in png format and the problem I am having is the output image at the end comes out with a dark background when you select it to be clear.

Test it so you can see what I mean. The username and password is: test

I have no idea how to fix this. I'd like the tickers to be transparent.

mincklerstraat

1:50 pm on Mar 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



We'll have a hard time testing this out - ww frowns on posting your own url's (a very good policy imho), and your website won't show up on your profile page until you've done quite a few more postings.

This could possibly be an ie problem, if you're using ie. Ie has problems with alpha transparency in png's. Try firefox, and if it works, just encourage your visitors to use firefox instead.

NewDesigner

4:32 pm on Mar 15, 2005 (gmt 0)

10+ Year Member



I do not think it's fair to ask users to use another browser for this feature. There are other sites that have this same kind of script, but yet they have been successful in getting their tickers to show up with a transparent background.

I understand ww's policy about not posting url, but it makes it difficult for those truly needing help. :(

mincklerstraat

5:12 pm on Mar 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you fiddle around with your graphics program, see if you can save your .png without an alpha transparency channel - so everything's either transparent, or no, but not in-between. If not, you'll have to generate gif's that your ticker thingie can use, ie has less problems with gifs than with pngs; there's no alpha channel in gifs. There's also some kind of option regarding saving background color which can come in handy for alpha transparent gifs when wrestling with ie, I think it allows ie to display parts which should be alpha transparent in some color other than the well-known abominable grey.

NewDesigner

5:49 pm on Mar 15, 2005 (gmt 0)

10+ Year Member



I tried playing around with my graphics program and it still causes the same problem.

My problem now is that a friend created this script and is out of town and now I have no idea how to go about changing it to accept gif format instead. :(

Thanks for the reply. Truly appreciate it.

NewDesigner

6:46 pm on Mar 15, 2005 (gmt 0)

10+ Year Member



Do you think if I went through each file and just changed where it states png to gif it should work?

If so, I have a database also set up for it, so I have to make any changes to that as well?

Any help is so truly appreciated. I can not tell you how badly I want this script to function correctly.

chadmg

6:55 pm on Mar 15, 2005 (gmt 0)

10+ Year Member



Did you try viewing the image in another browser to see if the image is correct? If it is IE that is the problem, are you using a solution to help it display PNG's correctly? Internet Explorer does not have native support for alpha transparencies in PNG's. Try doing a Google Search [google.com] to find out how to make it work in IE.

NewDesigner

7:12 pm on Mar 15, 2005 (gmt 0)

10+ Year Member



You can view it fine with foxfire per someone else that tested it. But when I inserted the tag needed to view the png correctly, the outpout ticker still came out with the colored background. I'm just over this png situation. I just didn't know if php supported gifs. Now that I know it does I'm wondering how I can change all the files to make it work with gif format.

mincklerstraat

8:02 am on Mar 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the sticky, unfortunately I can't find where that ticker is on your site.

Regarding changing the pngs to gifs: you'll need to open a graphics editor, open each png, and then save as the gif fileformat. Just changing the extension won't work.

The tags to get ie to render pngs correctly can be a pain in the *** sometimes, I've noticed for example that they only work with certain dtd's (not with xhtml transitional or html strict).

You haven't really said how this thing works. PHP works with gifs just fine if it's only a matter of displaying gifs you've already made. It just has to output the <img src> tag that calls the proper gif. New PHP installs also allow you to dynamically create gifs. If your script is just calling up images, this would be the easiest to change from png to gif. If it's creating the images, you'll have to work out the ins and outs of image transparency with functions like imagealphatransparent() to get your pngs to show up right in ie, and that can be a pain if you're pretty new to this kind of thing.

I wish you the best of luck.