Apparently, it's a known issue in how FW determines indexed palettes and I haven't heard of a workaround.
If your PNG8 is fully opaque, can you use Photoshop? Photoshop will give you 256 colors. But I don't think it can give you semi-transparent colors in PNG8.
Telling it to use 256 (the max limit for index/png8) colors even though it 'reads' 45 simply means thats all the colors it finds. Not that Fw 'truncates' the remaining colors. Ps does the same thing with these two formats. It's simply the nature of the algorithm, there's nothing you can do about it.
In your example, its a mere two tone color (a fill color stop for the top gradient, and a fill color stop for the bottom gradient). The gradation between those two is 45.
Edit your Gradient and add more (stop) colors between the top/bottom, go to the Optimize Panel and hit 'Rebuild'. It should change (increase).
Keep adding (extreme) color stops until it reaches the limit allowed.
For non-banded gradients, I always resort to .jpg/png32, they offer 'millions' of colors between the first, the next and the last for smoother transistions.
You seem to be saying that this is expected and normal behavior, and that Photoshop would produce the same result, but in fact Photoshop does *not* produce the same result. To demonstrate, I have created the exact same gradient and saved it in the exact same format (PNG8 with Adaptive color) in both Photoshop and Fireworks. The Photoshop result produces colors like I would expect whiel the Fireworks one does not. They can't be using the same algorithm, and the Fireworks one seems to be wrong. Screenshots of the Photoshop "Save for Web" and Fireworks "Export" dialogs below:
The gradient is on a 500px wide, 60px tall image going form #0000ff to #66ffff
Photoshop: notice how it uses all 256 possible colors
Fireworks: notice how it does not use all colors, and has the same settings as in Photoshop:
And, as further evidence, here are the resulting images that are produced by both applications, clearly demonstrating the difference -- again, both are PNG8, Adaptive color images:
This seems like a pretty significant bug to me and I am surprised both that Adobe shipped this product with such a significant defect and that I can't seem to find other discussions that clearly illustrate this point.
Thanks, I did in fact end up using Photoshop to do this, but only after spending a decent bit of time trying to figure out what I was doing wrong in Fireworks. Do you have any pointers to where this issue has been pointed out elsewhere? I would like to make sure that the Adobe folks are aware of this bug, as it causes a decent bit of inconvenience and confusion.
In Fireworks, you can also try switching to the Exact colour palette.
That tends to yield better results. Going this route, I got 252
colours and a significantly better quality gradient.
Additionally, the exported PNG from FW weighted in at just under 2k.
The PS file was 15k.
Give this a try and see if it works for you
Thanks b019 for that followup, and correction.
I just did your second test and got the same result as you.
But in terms of your first example, where the shape is shorter, but longer PS still 'sees/outputs' a different result (and the same as Fw), if your image width is less than 256, still ignores the difference. Create another PS doc smaller than 256 (say 176) using the same two gradient colors. Do the same for Fw! It will be same result.
Good observation on the larger size images and discrepency between Fw/Ps.
Oops, disregard my post; you've already been that route. Serves me right for coming late to the party. :-(
Nothing wrong with a little reminder Jim
I have the same problem.
However, I found this bug in CS4 version. But it appears only after version 10.0.0.3.. (or something). In the beging everything was okey and Fireworks works perfectly fine (except CS4 version is a damn memory leak ******* and have a lack of features)
Also that's so fun to read all this answers to your post)))
They are so sensless and delirious
When you telling about bug , they say: "its not a bug, its a feature.. its simply the nature of ALGORITHM "
Damn Adobe team. I hope they will begin to do something... at least when everybody get bored of "Adobe bugs and solutions" and stop buying it
Here is an example of wrong behaviour in Fireworks
It is with russian comments, but they are not necessary, since problem was described here.