DriverHeaven.net

 
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   DriverHeaven.net > Forums > Software / Tools > Programming, Coding, (Web)Design


Reply
 
LinkBack Thread Tools
Old Jan 18, 2003, 09:31 AM   #1
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
Rep Power: 0
UberLord is on a distinguished road

Cool! PNG Filter for IE on Win32

If you use PNG images over say GIF images and really hated when IE on Windows doesn't support the alpha channel (for transparent backgrounds)?

Well, panic no more. DriverHeaven is running a special filtering javascript that filters all IMG tags pointing to a PNG file through a DirectX control so that transparencies work with IE 5.5 or higher

Credit where credit is due. Thanks goto the guys at WebFX for the initial solution. I couldn't get their .htc file to work for anyone but me, so I wrote this little javascript instead.

I've put it under the LGPL, so feel free to use it on your own websites at no charge. If you can make any improvements to the code, then email them to me at uberlord@driverheaven.net or post them here!

Download the JavaScript file here

Use the follow code in your script to reference it
Code:
<script type="text/javascript" language="javascript" src="ieWin32_png_filter.js">
    <!-- Forces IE to display PNG images through DirectX -->
</script>
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote


Old Jan 20, 2003, 05:16 AM   #2
Unbiased.
 
Join Date: Jun 2002
Posts: 4,812
Rep Power: 0
ToshiroOC is on a distinguished road

Though I know I personally won't have much use for it, I just want to thank Uberlord for releasing it under the LGPL - its pretty important to keep things freely available
__________________
[img][/img]
[color=White]Peace be with you, Joe.[/color]
Driverheaven Staff Member (Supermoderator)
ToshiroOC is offline   Reply With Quote
Old Jan 20, 2003, 05:57 AM   #3
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
Rep Power: 0
UberLord is on a distinguished road

Quote:
Originally posted by ToshiroOC
Though I know I personally won't have much use for it, I just want to thank Uberlord for releasing it under the LGPL - its pretty important to keep things freely available
I see no point in charging for it. And I'd much rather promote PNG - which is patent free - over GIF which isn't and costs.

Besides, if anyone can improve on my code then they're more than welcome to
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old Jan 20, 2003, 06:23 AM   #4
confutatis maledictis
 
Vampyromaniac's Avatar
 
Join Date: May 2002
Location: somewhere dark
Posts: 5,974
Rep Power: 60
Vampyromaniac is a jewel in the roughVampyromaniac is a jewel in the roughVampyromaniac is a jewel in the roughVampyromaniac is a jewel in the rough
System Specs

I liked the quality of PNG when I first saw it, but nobody seems to use it . . .

Also, great scripting, man
Vampyromaniac is offline   Reply With Quote
Old Jan 20, 2003, 09:49 AM   #5
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
Rep Power: 0
UberLord is on a distinguished road

Quote:
Originally posted by Vampyromaniac
I liked the quality of PNG when I first saw it, but nobody seems to use it . . .
Me 2 - hopefully people can start using PNG's now
However, JavaScript is required and some peeps disable it completely.
I'd still prefer MS to fix bloody IE though

Quote:
Also, great scripting, man
I really like my ego being stroked - thats why I'm a developer
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old Jan 20, 2003, 01:31 PM   #6
BSD SMASH!
 
Malus's Avatar
 
Join Date: May 2002
Location: A rabbit hole. . .
Posts: 1,170
Rep Power: 0
Malus is on a distinguished road

A lot of people prefer .gif because they have a smaller filesize. Personally, I think the .png's are pretty nice though.
__________________
quad (FreeBSD/amd64 8-CURRENT): Intel Q6600 - Asus P5E-VM HDMI - 2x2 GB Kingston PC6400 DDR2 Ram - Seagate 320GB 7200RPM HD - 2xSeagate 1TB 7200RPM HD in RAID 1 via ZFS - Lite-On 20x DVD Multi Recorder - Coolermaster Centurion 5

router (FreeBSD/amd64 8-CURRENT):
Intel E4500 - Intel D945GCNL - 2 GB PC6400 Mushkin Ram - Lite-On 48x24x48x16 - Seagate 320GB 7200RPM HD - Silverstone SST-SG02-F

wanderer (FreeBSD/i386 7-CURRENT): Lenovo Thinkpad T61p

mini (OS X 10.5): Intel Core 2 Duo @ 1.8Ghz, 4 GB Mushkin PC5400 Ram -
Headroom MicroDAC

Portable sound: Rockboxed iPod Video -> Westone UM2's
Not-So-Portable Sound: Headroon MicroDAC -> Singlepower PPX3-SLAM -> Grado RS-1's or Beyerdynamic DT-880's
Very-Not-Portable-Sound: Squeezebox v3 -> Denon AVR-1507 -> B&W 683's & Sunfire HRS-10
Malus is offline   Reply With Quote
Old Jan 20, 2003, 01:32 PM   #7
enchanted
 
Zardon's Avatar
 
Join Date: May 2002
Location: Driverheaven
Posts: 32,260
Rep Power: 3150
Zardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his statusZardon is godlike in his status

gif are limited to 256 colours. which is why PNG has such a benefit.
Zardon is offline   Reply With Quote
Old Jan 20, 2003, 01:32 PM   #8
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
Rep Power: 0
UberLord is on a distinguished road

Thumbs Down!

Quote:
Originally posted by Malus
A lot of people prefer .gif because they have a smaller filesize. Personally, I think the .png's are pretty nice though.
Odd. All my PNG images bar 2 have smaller filesizes than GIF
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old Jan 20, 2003, 02:53 PM   #9
Yarr... I be blind!
 
Jeff's Avatar
 
Join Date: May 2002
Location: Calgary, Canada
Posts: 3,177
Rep Power: 0
Jeff is on a distinguished road

PNG also has lossless compression, and MNG has animation, PNG/MNG is just a heck of a lot better than all other single-layer graphic formats. (Aside from vector images)
__________________
Mr. Simpson, don't you worry. I watched Matlock in a bar last night. The sound wasn't on, but I think I got the gist of it. - Lionel Hutz
Jeff is offline   Reply With Quote
Old Jan 20, 2003, 06:44 PM   #10
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
Rep Power: 0
UberLord is on a distinguished road

???

Quote:
Originally posted by Cyborg
PNG also has lossless compression
I thought that GIF was lossless compression?
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old Jan 20, 2003, 06:56 PM   #11
Unbiased.
 
Join Date: Jun 2002
Posts: 4,812
Rep Power: 0
ToshiroOC is on a distinguished road

It is, but only for 256 bit I think...
__________________
[img][/img]
[color=White]Peace be with you, Joe.[/color]
Driverheaven Staff Member (Supermoderator)
ToshiroOC is offline   Reply With Quote
Old Jan 20, 2003, 07:31 PM   #12
Yarr... I be blind!
 
Jeff's Avatar
 
Join Date: May 2002
Location: Calgary, Canada
Posts: 3,177
Rep Power: 0
Jeff is on a distinguished road

Its not completely lossless, because of the way it has to dither it to 256 colors.
__________________
Mr. Simpson, don't you worry. I watched Matlock in a bar last night. The sound wasn't on, but I think I got the gist of it. - Lionel Hutz
Jeff is offline   Reply With Quote
Old Jan 20, 2003, 07:47 PM   #13
BSD SMASH!
 
Malus's Avatar
 
Join Date: May 2002
Location: A rabbit hole. . .
Posts: 1,170
Rep Power: 0
Malus is on a distinguished road

Actually, I'm mistaken. I'm thinking about JPEG vs 24-bit PNG. There is an 8-bit PNG which is probably comparable to the GIF format. 24-bit PNGs are really big though.
__________________
quad (FreeBSD/amd64 8-CURRENT): Intel Q6600 - Asus P5E-VM HDMI - 2x2 GB Kingston PC6400 DDR2 Ram - Seagate 320GB 7200RPM HD - 2xSeagate 1TB 7200RPM HD in RAID 1 via ZFS - Lite-On 20x DVD Multi Recorder - Coolermaster Centurion 5

router (FreeBSD/amd64 8-CURRENT):
Intel E4500 - Intel D945GCNL - 2 GB PC6400 Mushkin Ram - Lite-On 48x24x48x16 - Seagate 320GB 7200RPM HD - Silverstone SST-SG02-F

wanderer (FreeBSD/i386 7-CURRENT): Lenovo Thinkpad T61p

mini (OS X 10.5): Intel Core 2 Duo @ 1.8Ghz, 4 GB Mushkin PC5400 Ram -
Headroom MicroDAC

Portable sound: Rockboxed iPod Video -> Westone UM2's
Not-So-Portable Sound: Headroon MicroDAC -> Singlepower PPX3-SLAM -> Grado RS-1's or Beyerdynamic DT-880's
Very-Not-Portable-Sound: Squeezebox v3 -> Denon AVR-1507 -> B&W 683's & Sunfire HRS-10
Malus is offline   Reply With Quote
Old Jan 20, 2003, 08:04 PM   #14
Yarr... I be blind!
 
Jeff's Avatar
 
Join Date: May 2002
Location: Calgary, Canada
Posts: 3,177
Rep Power: 0
Jeff is on a distinguished road

not as big as you'd think, i'm using a 32-bit 189 x 355 PNG on my site, which works out to 9.3kb, full color, with alpha layer...
__________________
Mr. Simpson, don't you worry. I watched Matlock in a bar last night. The sound wasn't on, but I think I got the gist of it. - Lionel Hutz
Jeff is offline   Reply With Quote
Old Jan 20, 2003, 08:09 PM   #15
BSD SMASH!
 
Malus's Avatar
 
Join Date: May 2002
Location: A rabbit hole. . .
Posts: 1,170
Rep Power: 0
Malus is on a distinguished road

Really? Last time I used it, I was getting 100k+ files when I converted PSD which had a size of only 256x256 pixels.
__________________
quad (FreeBSD/amd64 8-CURRENT): Intel Q6600 - Asus P5E-VM HDMI - 2x2 GB Kingston PC6400 DDR2 Ram - Seagate 320GB 7200RPM HD - 2xSeagate 1TB 7200RPM HD in RAID 1 via ZFS - Lite-On 20x DVD Multi Recorder - Coolermaster Centurion 5

router (FreeBSD/amd64 8-CURRENT):
Intel E4500 - Intel D945GCNL - 2 GB PC6400 Mushkin Ram - Lite-On 48x24x48x16 - Seagate 320GB 7200RPM HD - Silverstone SST-SG02-F

wanderer (FreeBSD/i386 7-CURRENT): Lenovo Thinkpad T61p

mini (OS X 10.5): Intel Core 2 Duo @ 1.8Ghz, 4 GB Mushkin PC5400 Ram -
Headroom MicroDAC

Portable sound: Rockboxed iPod Video -> Westone UM2's
Not-So-Portable Sound: Headroon MicroDAC -> Singlepower PPX3-SLAM -> Grado RS-1's or Beyerdynamic DT-880's
Very-Not-Portable-Sound: Squeezebox v3 -> Denon AVR-1507 -> B&W 683's & Sunfire HRS-10
Malus is offline   Reply With Quote
Old Jan 21, 2003, 05:14 AM   #16
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,256
Rep Power: 0
UberLord is on a distinguished road

Quote:
Originally posted by Malus
Really? Last time I used it, I was getting 100k+ files when I converted PSD which had a size of only 256x256 pixels.
Depends on which program you use really.
PSP 6 on Win32 which I sometimes use @ work produces PNG files about twice as big as say The GIMP on Linux.
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old Jan 21, 2003, 11:36 AM   #17
Yarr... I be blind!
 
Jeff's Avatar
 
Join Date: May 2002
Location: Calgary, Canada
Posts: 3,177
Rep Power: 0
Jeff is on a distinguished road

I find PS7 does a good job of them, didn't ever try it with older versions of PS>
__________________
Mr. Simpson, don't you worry. I watched Matlock in a bar last night. The sound wasn't on, but I think I got the gist of it. - Lionel Hutz
Jeff is offline   Reply With Quote
Reply

Bookmarks

Thread Tools