Hot answers tagged transparency
12
JPEGs are not always smaller in size than PNGs. Each format has its uses. JPEGs are great for complex images like photographs and will have a smaller file size than PNGs when compressing a photo. PNGs are great for logos or buttons and will be smaller than a JPEG when compressing those kinds of images.
JPEGs do not support transparency so what you're ...
7
There is a jQuery plugin for it here, or the following script also does a good job (just call it in your <body onload="">;
function fixPNG(){
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (version < 7) && (document.body.filters))
...
5
"On adding alpha channels to JPEG images" requires you to embedded the PNG alpha layer into the JPEG image as metadata, and then use Javascript to convert the <img> tag to <canvas> and process that alpha layer.
His example works in Firefox and Webkit browsers, but not in my IE8.
Given the amount of work (preparing a JPEG file with PNG alpha ...
2
It's hard to answer without knowing what browser you're experiencing the problems in, the code you talk about isn't cross browser compliant.
Best way to achieve a cross browser gradient, outside of using html 5, is to use a transparent 24-bit png.
1
JPEG compression artefacts would mean that a lot of pixels you might expect to be #d67fff aren't - unless you use lossless JPEG, in which case you're not getting the compression benefits you expressly want.
In the future you may be able to do this with CSS clip, but at the moment arbitrary polygons don't see to be supported.
The best way to achieve this ...
1
If you're OK with GIF-like transparency (in IE6 only), then use PNG8+Alpha (paletted, but with semitransparencies).
It gives full alpha in all other browsers. Does not require slow and finicky DX Filters (on which all IE6 PNG24 fixes are based on).
Fireworks and pngnq/pngquant can save this format (I wrote Mac GUI for them).
Adobe Photoshop is the only ...
Only top voted, non community-wiki answers of a minimum length are eligible