10 Replies Latest reply on Sep 15, 2010 4:10 AM by SublimeYe.ua

    optimizing a gradient doesn't work correctly

    b019

      I'm trying to optimize a gradient background on a page as a PNG 8 with Adaptive color scheme.  But even if I tell it to use 256 colors, it will only use 45 colors, resulting in a lot of banding in the image.  If I use Exact colors, it does what I expect.  But I'd like to be able to optimize to a specific number of colors (say, 128) which doesn't seem to be possible, since FW always reverts to 45 colors (unless I tell it to use less than 45 colors, in which case it uses the smaller number).  Also, I am aware that I could use a JPEG format, which may be better in this particular instance.  But the general issue still has me baffled -- why is Fireworks not using the number of colors I select, and how can I correct it?

       

      Thanks...

       

      (Note, in the screenshot below the images are zoomed in just to demonstrate the banding.  Notice that I've selected 256 colors in the optimize options, but it is limiting the pallete to 45 colors)

       

      Picture 2.png

        • 1. Re: optimizing a gradient doesn't work correctly
          pixlor Level 4

          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.

          • 2. Re: optimizing a gradient doesn't work correctly
            heathrowe Most Valuable Participant

            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.

             

            h

            • 3. Re: optimizing a gradient doesn't work correctly
              b019 Level 1

              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

              Picture 3.png

               

              Fireworks: notice how it does not use all colors, and has the same settings as in Photoshop:

              Picture 4.png

               

              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:

               

              Photoshop output:

              test_photoshop.png

               

              Fireworks output:

              test_fireworks.png

               

              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.

              • 4. Re: optimizing a gradient doesn't work correctly
                b019 Level 1

                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.

                • 5. Re: optimizing a gradient doesn't work correctly
                  Jim_Babbage Level 4

                  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

                   

                  Jim Babbage

                  • 6. Re: optimizing a gradient doesn't work correctly
                    heathrowe Most Valuable Participant

                    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.

                     

                    h

                    • 7. Re: optimizing a gradient doesn't work correctly
                      Jim_Babbage Level 4

                      Oops, disregard my post; you've already been that route. Serves me right for coming late to the party. :-(

                      • 8. Re: optimizing a gradient doesn't work correctly
                        heathrowe Most Valuable Participant

                        Nothing wrong with a little reminder Jim

                         

                        h

                        • 9. Re: optimizing a gradient doesn't work correctly
                          SublimeYe.ua Level 1

                          Hi b019,

                           

                          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

                          • 10. Re: optimizing a gradient doesn't work correctly
                            SublimeYe.ua Level 1

                            Here is an example of wrong behaviour in Fireworks

                             

                            It is with russian comments, but they are not necessary, since problem was described here.