TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-07-2008, 05:16 PM   #1 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default PNG Transparency in IE 6

How could I fix the images for IE 6 so it doesn't have that weird BG :P..
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote
Old 01-07-2008, 06:15 PM   #2 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default

There are a few people out there that have written solutions to this issue.

This one (conditional HTML, and a JS) was released in 06, but works very well. It doesn't work for background PNGs though.

PNG in Windows IE

This one I haven't tried but has support for background PNGs: IE PNG Fix - TwinHelix. This one adds in some CSS trickery as well as JS and conditional html.
obolus is offline  
Reply With Quote
The Following User Says Thank You to obolus For This Useful Post:
Nor (01-08-2008)
Old 01-08-2008, 12:56 AM   #3 (permalink)
The Acquainted
 
Join Date: Sep 2007
Location: Arizona
Posts: 114
Thanks: 10
Andrew is on a distinguished road
Default

I would recommend the one obolus suggested in the latter portion of his post. I've tried it out a bit, but when I tried it, it didn't support CSS background images, but now that it does, it might be worth a try.
Send a message via AIM to Andrew Send a message via MSN to Andrew
Andrew is offline  
Reply With Quote
Old 01-08-2008, 01:11 AM   #4 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Part of the difficulty with IE displaying PNGs correctly has to do with the built in gamma settings, not just a lack of transparency support. IE7 appears to fix this, but anything lower will experience this problem with the gamma settings. One fix for that is to strip the image's gamma part and set it to zero, which solves that trouble. See more here.

So unfortunately you'll probably need both fixes if you want to use PNG images.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
The Following 2 Users Say Thank You to RobertK For This Useful Post:
Kalle (01-08-2008), Nor (01-08-2008)
Old 01-08-2008, 11:27 PM   #5 (permalink)
The Frequenter
Zend Certified 
 
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
Kalle is on a distinguished road
Default

Quote:
Originally Posted by RobertK View Post
Part of the difficulty with IE displaying PNGs correctly has to do with the built in gamma settings, not just a lack of transparency support. IE7 appears to fix this, but anything lower will experience this problem with the gamma settings. One fix for that is to strip the image's gamma part and set it to zero, which solves that trouble. See more here.

So unfortunately you'll probably need both fixes if you want to use PNG images.
Ah thanks for a great article read =)
Send a message via MSN to Kalle Send a message via Skype™ to Kalle
Kalle is offline  
Reply With Quote
Old 01-12-2008, 10:13 PM   #6 (permalink)
The Wanderer
 
victorius's Avatar
 
Join Date: Nov 2007
Location: Denmark
Posts: 21
Thanks: 4
victorius is on a distinguished road
Default

I have no experience with TweakPNG but I've used with great effect pngcrush.

As that is a command line utility, I made a .BAT file that will process for example a directory of png images and remove all color information. The .BAT file is essentially just all the parameters because then I don't need to remember them.

How to remove the color with pngcrush

RobertK says you set the gamma part to 0. Like I said, I have no experience with TweakPNG but with pngcrush you remove the color information and that reduces filesize. Sometimes by alot.


Just yet another way to do things
Send a message via MSN to victorius
victorius is offline  
Reply With Quote
Old 01-08-2008, 01:10 PM   #7 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default

Thanks I'll read what you said.
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote
Old 01-12-2008, 10:24 PM   #8 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Well, colorinformation == gamma. Maybe a little different in naming, but I doubt you use only grayscale PNGs. It's the information that tells different systems how to interpret those RGBA colors that IE needs to ignore.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-12-2008, 11:12 PM   #9 (permalink)
The Wanderer
 
victorius's Avatar
 
Join Date: Nov 2007
Location: Denmark
Posts: 21
Thanks: 4
victorius is on a distinguished road
Default

Quote:
colorinformation == gamma
I disagree. I think that in this case the gamma is just a constant. Really just saying: "ok, see that color information there? Display it with this gamma level".

So setting that to 0 will neutralize the effect of the gamma level, but all the color correction information is still there.

So, technically we're both wrong. We aren't really talking about "color information". The correct term (for what we are discussing) is "color correction information".

Quote:
The main use of pngcrush is for reducing the size of the image data contained in the IDAT section.
Quote:
pngcrush has one advantage over the other programs because it can remove all the color-correction data (gamma, white balance, ICC color profile, standard RGB color profile) from PNG files.....

... Since most graphics software embed the extra color-correction data, which is normally not needed, this can produce file sizes that are up to 40 % smaller than the original. Greater reductions come from PNG images that have 256 colors or less (indexed color).
Send a message via MSN to victorius
victorius is offline  
Reply With Quote
Old 01-12-2008, 11:37 PM   #10 (permalink)
The Addict
Top Contributor Good Samaritan 
 
Join Date: Jan 2008
Location: USA
Posts: 217
Thanks: 16
RobertK is on a distinguished road
Default

Haha, fine get technical. Two ways to solving the same problem.

I just hope it doesn't save in CMYK, its color range is slightly less vibrant.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
RobertK is offline  
Reply With Quote
Old 01-14-2008, 01:56 PM   #11 (permalink)
Nor
The Addict
 
Join Date: Nov 2007
Posts: 282
Thanks: 61
Nor is on a distinguished road
Default

I tried tweakpng and it didn't work..
__________________
PHP/XHTML Freelancer:
Cleanscript.com v3 - Programming starting at just $5 act now!
Nor is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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


All times are GMT. The time now is 10:33 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design