Forum Moderators: not2easy
I use dreamweaver to assemble my pages and psp 8 to create my images for the most part. Ok here is my question.
I want to create a horizontal image using gradient from say white to red that is 1 pixel high and 650 wide. Then I want to make a vertical image that also uses a gradient from white to grey and is 700 pixels high and 1 wide. I then want to somehow merge them and build my layout on top of that. I know I could easily make an image 650X700 and mix them that way then set that as my background....but wouldn't it be better if I could somehow tile both images and mix them that way?
As far as I know (feel free to correct me - anyone)
A gif image offers either 0% or 100% transparency for any given pixel. What you want is something like 50% transparency for all pixels. This is usually done with an alpha channel ie instead of the usual 3 colour channels (rgb) you have another for transparency: r,g,b and alpha - where each channel is 1-100% for each pixel.
I believe a png image will provide alpha transparency but the problem is the browsers. IE is by far the most popular browser. Whilst IE supports png I don't think IE supports alpha transparency.
If your requirement is for a select audience you can ask them to get a browser that supports alpha transparency (sorry I don't know which). However if your requirement is for a general audience its not effective to ask them to change browsers.
So I don't think it will work.
So how do I cut down on my 59 KB image without making it look blocky? I know there are optimizers and stuff but I haven't really worked with any. If I have to I'll just use a solid background and spruce it up a bit.
hth
If you really want a diagonal gradient. Use photoshop or fireworks and optimise your file: probably as a .jpg with a lot of 'blur'. The blur will reduce your file size. I imagine as you don't have any detail in the image - blur will not hurt it much.
Whilst IE supports png I don't think IE supports alpha transparency.
Actually, IE does technically support alpha transparency for PNGs. It's just a pain in the neck. Instead of just displaying the PNG as normal, you have to use a filter for it. Also, it can't be a background image and it can't be an IMG - it has to be a DIV (or maybe other block elements). To get the effect you want, you'd set its width to the width you want your image stretched to and lay the DIV that uses the filter on top of the other gradient image.
A List Apart has a fairly complete article [alistapart.com] describing the method, if it doesn't sound like too much hassle. It will give you the effect you describe, so it may be worth a shot.
<DIV ID="myDiv" STYLE="position:relative; height:250px; width:250px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='myimage.png',sizingMethod='scale');"></DIV>
hth,
g.