17 Replies Latest reply on Aug 15, 2009 9:24 AM by dmwalk

    Appending alpha transparency swatches to a CLUT

    nate.reeves@gmail.com
      I have a 160 swatch color table I generated in PS and I'd like to append some alpha transparency values to it for PNG8 processing.

      In Fireworks CS4 I've loaded up a test image, successfully loaded in the .act file I exported from PS and then selected 'Alpha Transparency' from the trns pulldown menu. Briefly some new swatches show up in the swatch palette, but then they disappear. I've tried everything I can think of. If there was a way to manually add and edit the transparency swatches to the act that would be ideal, but when I try to add swatches to the table I don't see any way to edit the transparency value, only RGB/HEX etc.. I'm somewhat stuck at the moment.

      Is there a way to do this? Maybe even some sort of independent color table editor?

      It's important that I have exact control over the CLUT file used as the device that the images will be running on can only have one CLUT active at any time, and all of the images in the UI need to be built to reference this single table.

      Another tangental issue I've encountered is that the PNG8 alpha transparency in FW seems to be restricting itself for some reason. For example, I've created a 256 pixel wide image in PS with a black ramp that goes from 100% opaque to 100% transparent across x-axis. I open this in FW, select PNG8, adaptive, 256 colors, alpha transparency and I only get 16 swatches (4bit?), completely faceting my ramp - however I've seen others online getting 8bit values of transparency using this same method...

      For example Here and Here

      Any and all feedback much appreciated.

      Nate
        • 1. Re: Appending alpha transparency swatches to a CLUT
          Level 7
          natronix wrote:

          > Another tangental issue I've encountered is that the PNG8 alpha transparency
          > in FW seems to be restricting itself for some reason. For example, I've created
          > a 256 pixel wide image in PS with a black ramp that goes from 100% opaque to
          > 100% transparent across x-axis. I open this in FW, select PNG8, adaptive, 256
          > colors, alpha transparency and I only get 16 swatches (4bit?), completely
          > faceting my ramp - however I've seen others online getting 8bit values of
          > transparency using this same method...
          >
          > For example
          > http://www.punchkickinteractive.com/blog/index.php/adobe/cs3/flash/learn-how-to-
          > cut-the-size-of-transparent-images-for-the-web-by-more-than-70-using-fireworks/
          > and http://www.communitymx.com/content/article.cfm?cid=E4024
          >
          > Any and all feedback much appreciated.
          >
          > Nate
          >
          Hi Nate:

          Is your canvas set to transparent?

          --
          Jim Babbage - .:Community MX:. & .:Adobe Community Expert:.
          http://www.communityMX.com/
          ---
          .:Adobe Community Expert for Fireworks:.
          http://www.adobe.com/communities/experts/members/206.html
          ---
          • 2. Re: Appending alpha transparency swatches to a CLUT
            nate.reeves@gmail.com Level 1
            Jim,

            Yes it is - I'm bringing it over from PS as a PNG32 with trans canvas - I can see the grid pattern in the background, upon setting alpha transparency in the optimize palette it generates 16 trans swatches, even though there are 256 values present on the canvas and I've set it to 256 colors / adaptive sampling.

            I also tried a full color PNG32 with no trans, I can't seem to get it to build a full 256 color palette with adaptive sampling, it seems to cap out at 101 colors and is causing quite visible banding in my sample. Is there some kind of 'document profile' setting that I have to override? It seems to behave quite differently than the optimize window in save for web under PS..
            • 3. Re: Appending alpha transparency swatches to a CLUT
              Level 7
              natronix wrote:
              > Jim,
              >
              > Yes it is - I'm bringing it over from PS as a PNG32 with trans canvas - I can
              > see the grid pattern in the background, upon setting alpha transparency in the
              > optimize palette it generates 16 trans swatches, even though there are 256
              > values present on the canvas and I've set it to 256 colors / adaptive sampling.
              >
              > I also tried a full color PNG32 with no trans, I can't seem to get it to build
              > a full 256 color palette with adaptive sampling, it seems to cap out at 101
              > colors and is causing quite visible banding in my sample. Is there some kind of
              > 'document profile' setting that I have to override? It seems to behave quite
              > differently than the optimize window in save for web under PS..
              >
              You can check the Options menu and deselect Remove Unused colors. That
              might help, but Fireworks seems to want to limit the color range in
              several scenarios. I honestly can't say why.

              --
              Jim Babbage - .:Community MX:. & .:Adobe Community Expert:.
              http://www.communityMX.com/
              ---
              .:Adobe Community Expert for Fireworks:.
              http://www.adobe.com/communities/experts/members/206.html
              ---
              • 4. Re: Appending alpha transparency swatches to a CLUT
                nate.reeves@gmail.com Level 1
                I've tried that.. doesn't change the behavior one bit.
                Have looked up and down the manual and been completely through the menu and palette system.

                'm stuck...
                *dies*
                • 5. Appending alpha transparency swatches to a CLUT
                  nate.reeves@gmail.com Level 1
                  Hi Jim,
                  What version of Fireworks were you using in that tutorial?
                  Any chance you could save out a color table from that sample and post it? I've tried saving .act files where I have alpha transparent swatches, and when I load the table back into Fireworks all of those swatches are coming back in pre-matted on white (no transparency information). I've opened up the resource forks for a couple .act files and I can't see any hex information for the alpha trans swatches, they all register 00 00 00 ..

                  Does anyone know if .act files can store transparency information?

                  Is there a known issue with Fireworks CS4 (Macintosh) and it's image optimization palette?

                  Any other options besides Fireworks for creating 8bit color, 8bit alpha PNG files?

                  Thanks...
                  • 6. Re: Appending alpha transparency swatches to a CLUT
                    Level 7
                    natronix wrote:
                    > I have a 160 swatch color table I generated in PS and I'd like to append some
                    > alpha transparency values to it for PNG8 processing.

                    8bit PNG files provides for only transparent color, just as for GIF
                    files. If you want full, variable transparency you have to use the 32bit
                    PNG format.

                    --
                    Linda Rathgeber - Adobe Community Expert
                    http://www.adobe.com/communities/experts/members/8.html
                    --------------------------------------------------------------
                    • 7. Re: Appending alpha transparency swatches to a CLUT
                      nate.reeves@gmail.com Level 1
                      I've seen PNG8s with 8bit color 8 bit alpha using the alpha transparency setting in Fireworks, though I've only seen it in Fireworks, and from the looks of it CS2 or 3... I have links to two examples in my first post.

                      I myself have been able to generate them with 16 alpha values in the indexed palette, unfortunately I'm unable to get those swatch values into a pre-existing table or get any more than 16. The optimize palette in Fireworks CS4 feels rather buggy to me, but then I'm primarily accustomed to using the one in Save For Web in PS.. only going to FW for the added alpha support on PNG8s....
                      • 8. Re: Appending alpha transparency swatches to a CLUT
                        Level 7
                        natronix wrote:
                        > Hi Jim,
                        > What version of Fireworks were you using in that tutorial?
                        > Any chance you could save out a color table from that sample and post it? I've
                        > tried saving .act files where I have alpha transparent swatches, and when I
                        > load the table back into Fireworks all of those swatches are coming back in
                        > pre-matted on white (no transparency information). I've opened up the resource
                        > forks for a couple .act files and I can't see any hex information for the alpha
                        > trans swatches, they all register 00 00 00 ..
                        >
                        > Does anyone know if .act files can store transparency information?
                        >
                        > Is there a known issue with Fireworks CS4 (Macintosh) and it's image
                        > optimization palette?
                        >
                        > Any other options besides Fireworks for creating 8bit color, bit alpha PNG
                        > files?
                        >
                        > Thanks...
                        >

                        Hi Nate:

                        It was either CS3 or CS4 on the PC.

                        I don't have that file anymore, but I can whip up something else.

                        The issue of dropped colors is a known one to the engineers and we can
                        hope that it is addressed in an upcoming version.



                        --
                        Jim Babbage - .:Community MX:. & .:Adobe Community Expert:.
                        http://www.communityMX.com/
                        ---
                        .:Adobe Community Expert for Fireworks:.
                        http://www.adobe.com/communities/experts/members/206.html
                        ---
                        • 9. Re: Appending alpha transparency swatches to a CLUT
                          Level 7
                          Linda Rathgeber wrote:
                          > natronix wrote:
                          >> I have a 160 swatch color table I generated in PS and I'd like to
                          >> append some alpha transparency values to it for PNG8 processing.
                          >
                          > 8bit PNG files provides for only transparent color, just as for GIF
                          > files. If you want full, variable transparency you have to use the 32bit
                          > PNG format.
                          >

                          Actually you can create variable transparency with an 8-bit PNG file, FW
                          seems to be the only app which does it.

                          --
                          Jim Babbage - .:Community MX:. & .:Adobe Community Expert:.
                          http://www.communityMX.com/
                          ---
                          .:Adobe Community Expert for Fireworks:.
                          http://www.adobe.com/communities/experts/members/206.html
                          ---
                          • 10. Re: Appending alpha transparency swatches to a CLUT
                            nate.reeves@gmail.com Level 1
                            > The issue of dropped colors is a known one to the engineers and we can
                            > hope that it is addressed in an upcoming version.

                            I'm stunned that such a core function of this app is so heavily bugged.
                            I hope this is addressed in a patch very soon.

                            Thanks very much for the help.

                            Nate
                            • 11. Re: Appending alpha transparency swatches to a CLUT
                              Level 7
                              Jim Babbage .:CMX:. & .:Adobe Community Expert:. wrote:

                              > Actually you can create variable transparency with an 8-bit PNG file, FW
                              > seems to be the only app which does it.

                              Can you send me an example of one? :-)

                              --
                              Linda Rathgeber - Adobe Community Expert
                              http://www.adobe.com/communities/experts/members/8.html
                              --------------------------------------------------------------
                              • 12. Re: Appending alpha transparency swatches to a CLUT
                                nate.reeves@gmail.com Level 1
                                PNG8 with alpha transparency

                                This one only contains 16 transparent values, if the optimize palette functioned correctly it would be 255..
                                • 13. Re: Appending alpha transparency swatches to a CLUT
                                  Level 7
                                  natronix wrote:
                                  > I've seen PNG8s with 8bit color 8 bit alpha using the alpha transparency
                                  > setting in Fireworks, though I've only seen it in Fireworks, and from the looks
                                  > of it CS2 or 3... I have links to two examples in my first post.
                                  >
                                  > I myself have been able to generate them with 16 alpha values in the indexed
                                  > palette, unfortunately I'm unable to get those swatch values into a
                                  > pre-existing table or get any more than 16. The optimize palette in Fireworks
                                  > CS4 feels rather buggy to me, but then I'm primarily accustomed to using the
                                  > one in Save For Web in PS.. only going to FW for the added alpha support on
                                  > PNG8s....
                                  >
                                  Hi Nate:

                                  I was able to get alpha transparency with the file you linked to.

                                  Maybe I'm just not looking at things right, but I don't see 256 shades
                                  of gray in this file. Am I looking at the right file?

                                  --
                                  Jim Babbage - .:Community MX:. & .:Adobe Community Expert:.
                                  http://www.communityMX.com/
                                  ---
                                  .:Adobe Community Expert for Fireworks:.
                                  http://www.adobe.com/communities/experts/members/206.html
                                  ---
                                  • 14. Re: Appending alpha transparency swatches to a CLUT
                                    nate.reeves@gmail.com Level 1
                                    Jim,
                                    That one only contains 16 transparent values, if the optimize palette functioned correctly it would be 255.. the source image I started with contained a 256 pixel wide block, blending from opaque black to completely transparent (therefor 1 opaque color and 255 values of transparency).

                                    However when I select PN8, adaptive sampling, 256 colors and alpha transparency, that file is what Fireworks creates.

                                    I'd described this previously- the posting of this file was per Linda's request to see a PNG8 with non-index transparency, which it has, albeit not a full 8bits.

                                    On another note, I've opened up the .act files in a hex editor and can see that it does not contain an alpha attribute. So my initial concept of appending these new transparent values from Fireworks to the .act are moot. I've discovered the .pal color table format, which is almost identical to .act except it contains an extra hex pair for an alpha value.

                                    Apparently Photoshop use to support importing and exporting of .pal color table files. I don't know what version support stopped at. I've tested CS3 & 4 and they aren't playing nice.

                                    It appears as though I'll need to manually concatenate the .pal file starting with the existing .act table that I have, porting the hex values over, and then manually building out the transparent values I want. The next and final step will be to identify a version of Fireworks, or some other host, that can utilize .pal and run optimizations on the files I have. That or I get a patch to Fireworks that fixes the optimize panel, better yet a patch to Photoshop that enables alpha transparency in PNG8.. I'm not holding my breath.
                                    • 15. Re: Appending alpha transparency swatches to a CLUT
                                      Level 7
                                      natronix wrote:
                                      > Jim,
                                      > That one only contains 16 transparent values, if the optimize palette
                                      > functioned correctly it would be 255.. the source image I started with
                                      > contained a 256 pixel wide block, blending from opaque black to completely
                                      > transparent (therefor 1 opaque color and 255 values of transparency).
                                      >
                                      > However when I select PN8, adaptive sampling, 256 colors and alpha
                                      > transparency, that file is what Fireworks creates.
                                      >
                                      > I'd described this previously- the posting of this file was per Linda's
                                      > request to see a PNG8 with non-index transparency, which it has, albeit not a
                                      > full 8bits.
                                      >
                                      > On another note, I've opened up the .act files in a hex editor and can see
                                      > that it does not contain an alpha attribute. So my initial concept of appending
                                      > these new transparent values from Fireworks to the .act are moot. I've
                                      > discovered the .pal color table format, which is almost identical to .act
                                      > except it contains an extra hex pair for an alpha value.
                                      >
                                      > Apparently Photoshop use to support importing and exporting of .pal color
                                      > table files. I don't know what version support stopped at. I've tested CS3 & 4
                                      > and they aren't playing nice.
                                      >
                                      > It appears as though I'll need to manually concatenate the .pal file starting
                                      > with the existing .act table that I have, porting the hex values over, and then
                                      > manually building out the transparent values I want. The next and final step
                                      > will be to identify a version of Fireworks, or some other host, that can
                                      > utilize .pal and run optimizations on the files I have. That or I get a patch
                                      > to Fireworks that fixes the optimize panel, better yet a patch to Photoshop
                                      > that enables alpha transparency in PNG8.. I'm not holding my breath.
                                      >
                                      >
                                      Nate can you share the original 256 value set, even if it is in PSD form?

                                      --
                                      Jim Babbage - .:Community MX:. & .:Adobe Community Expert:.
                                      http://www.communityMX.com/
                                      ---
                                      .:Adobe Community Expert for Fireworks:.
                                      http://www.adobe.com/communities/experts/members/206.html
                                      ---
                                      • 16. Re: Appending alpha transparency swatches to a CLUT
                                        nate.reeves@gmail.com Level 1
                                        Sure I've added 3 files to this directory for you to review.

                                        256x20_source.psd
                                        The test source file. A 256 pixel wide ramp from R0G0B0 A100 -> R0G0B0 A0

                                        256x20_PNG24__PS-CS4.png
                                        An export through PS 'Save For Web' as PNG24, no prematte

                                        256x20_PNG8__FW-CS4.png
                                        An export through FW, settings PNG8, Adaptive, 256 colors, no prematte, alpha transparency

                                        The PNG8 from FW doesn't display correctly in Photoshop, it doesn't recognize the alpha hex pair in the index, but it should display fine in Fireworks or a web browser.
                                        • 17. Re: Appending alpha transparency swatches to a CLUT
                                          dmwalk Level 1

                                          The problem with banding in Fireworks PNG8 is due to the way FW renders colors with transparency. PNG8-exact will render up to 256 colors which eliminates banding in many images, but there is no alpha transparency, only index transparency. PNG8-Adaptive renders alpha transparency, but for some odd reason greatly reduces the number of colors in the image, generally producing banding. Here's the undocumented technique to use up to 256 colors with alpha transparency in Fireworks CS4.

                                           

                                          1. Build your color table with PNG8-Exact
                                          2. Select all the colors in the table and lock them.
                                          3. Rebuild your color table with PNG8-Adaptive-Alpha transparency.
                                          4. The alpha transparency colors are added to the exact colors in the table and produce a high quality PNG8 with alpha transparency. Of course if you still get banding with 256 colors, you'll have to go to a PNG32.

                                           

                                          This workaround proves that Adobe should be able to create the proper PNG8 Exact with alpha transparency setting. Adobe, please fix this to work properly so we don't have to use this workaround.