5 Replies Latest reply on Feb 20, 2009 6:04 AM by Newsgroup_User

    1x15px png = 1,262 bytes!  How do I strip exif/xmp meta data on export?

    gerran
      Hi

      I'm using Fireworks CS3 on Mac 10.4.11 to create png files used in my HTML/CSS layout (things like background gradients, rounded corners, etc.). Most of my pngs are really small pixel-wise (the largest is 15x15px). When Fireworks exports them, the images are all over 1kb in size. Looking at the exported .png files in a hex editor, the bulk of the file is meta data like "creation time", "EXtSoftware Adobe Fireworks CS3", and a huge block of <x:xmpmeta> XML. I don't want any of this meta data in the .png file. I need these images to be as small as possible to save bandwidth.

      I've tried exporting the .png as PNG32 using File -> Export and File -> Image Preview -> Export. Neither of these exports the .png without meta data. I've tried removing meta data from File -> File Info, but it won't let me delete some data and it doesn't seem to do anything. If I export the same image as GIF, it's 50 bytes. Granted there's no alpha channel in GIF, but still!

      It seems there's a bug in the PNG exporter where it doesn't strip meta data. Does anyone have a work-around for this? Even a command line image processor on the mac that can strip this data would be fine.

      Thanks!
        • 1. Re: 1x15px png = 1,262 bytes!  How do I strip exif/xmp meta   data   on export?
          Level 7
          gerran wrote:
          > Hi
          >
          > I'm using Fireworks CS3 on Mac 10.4.11 to create png files used in my HTML/CSS
          > layout (things like background gradients, rounded corners, etc.). Most of my
          > pngs are really small pixel-wise (the largest is 15x15px). When Fireworks
          > exports them, the images are all over 1kb in size. Looking at the exported
          > .png files in a hex editor, the bulk of the file is meta data like "creation
          > time", "EXtSoftware Adobe Fireworks CS3", and a huge block of <x:xmpmeta> XML.
          > I don't want any of this meta data in the .png file. I need these images to be
          > as small as possible to save bandwidth.
          >
          > I've tried exporting the .png as PNG32 using File -> Export and File -> Image
          > Preview -> Export. Neither of these exports the .png without meta data. I've
          > tried removing meta data from File -> File Info, but it won't let me delete
          > some data and it doesn't seem to do anything. If I export the same image as
          > GIF, it's 50 bytes. Granted there's no alpha channel in GIF, but still!
          >
          > It seems there's a bug in the PNG exporter where it doesn't strip meta data.
          > Does anyone have a work-around for this? Even a command line image processor
          > on the mac that can strip this data would be fine.
          >
          > Thanks!
          >
          This is a known issue which was fixed in CS4. For CS3, the workaround is
          to close the file and reopen it. Go directly to File > Export, before
          choosing File > Save. That should fix the problem. If not, let us know.

          --
          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: 1x15px png = 1,262 bytes!  How do I strip exif/xmp meta   data   on export?
            gerran Level 1
            Hi Jim

            Thanks for the response. Unfortunately this doesn't work for me. However, it did give me an idea that did work. I was able to get FW to export properly by doing the following:

            1. Unlock all layers in my main file and select everything.
            2. Copy everything to the clipboard.
            3. Create a new untitled file (FW will automatically know the proper canvas size based on the clipboard size)
            4. Paste the layers into the new file.
            5. File -> Export the untitled file to the desired output file without saving.

            My file is now 207 bytes, much better than before. Thanks for the idea.

            However, the exported file still contains metadata for "tExtCreation Time" and "tEXtSoftware Adobe Fireworks CS3", which amounts to another 60+ bytes of wasted space. I'd like to suggest a feature. It would be great if FW had a "super lean" export mode that exported nothing but the minimum amount of image data and nothing else. The reason I'm so picky about this is because these files are used in an environment where they will be requested 100 million times/month. Those extra 60 bytes will result in an extra 6GB of bandwidth for the month. Not a huge deal, but it all adds up.

            Thanks for the help!
            • 3. Re: 1x15px png = 1,262 bytes!  How do I strip exif/xmp   meta   data     on export?
              Level 7
              gerran wrote:
              > Hi Jim
              >
              > Thanks for the response. Unfortunately this doesn't work for me. However, it
              > did give me an idea that did work. I was able to get FW to export properly by
              > doing the following:
              >
              > 1. Unlock all layers in my main file and select everything.
              > 2. Copy everything to the clipboard.
              > 3. Create a new untitled file (FW will automatically know the proper canvas
              > size based on the clipboard size)
              > 4. Paste the layers into the new file.
              > 5. File -> Export the untitled file to the desired output file without saving.
              >
              > My file is now 207 bytes, much better than before. Thanks for the idea.
              >
              > However, the exported file still contains metadata for "tExtCreation Time" and
              > "tEXtSoftware Adobe Fireworks CS3", which amounts to another 60+ bytes of
              > wasted space. I'd like to suggest a feature. It would be great if FW had a
              > "super lean" export mode that exported nothing but the minimum amount of image
              > data and nothing else. The reason I'm so picky about this is because these
              > files are used in an environment where they will be requested 100 million
              > times/month. Those extra 60 bytes will result in an extra 6GB of bandwidth for
              > the month. Not a huge deal, but it all adds up.
              >
              > Thanks for the help!
              >
              Well all that copying and pasting should not have been required. As for
              the feature, go to the Adobe web site and fill out the Wish list form.
              This documents it and it is sent ot the engineering team.

              If you want, you can post a link or email me the file to see if the same
              problem occurs in CS4.

              --
              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: 1x15px png = 1,262 bytes!  How do I strip exif/xmp   meta   data     on export?
                gerran Level 1
                If anyone else out there is having similar issues, I found a pretty nice tool on unix/mac to really shrink png files down:

                http://pngcrush.darwinports.com/ (mac install)
                http://pmt.sourceforge.net/pngcrush/ (unix/source install)

                pngcrush turned my 1,262 byte png file into a 97 byte png file. pngcrush can strip any unneeded data blocks from the png file and it will also optimize the compression of the image data. The result is a dramatically smaller file with no loss in image quality. The command line I use is:

                # pngcrush -brute -rem alla <input png> <output png>

                The "-rem alla" option tells it to strip all non-image data from the png and the "-brute" forces it to try over 100 different compression techniques to find the best one.

                I tried pngcrush on a larger png file that was 8936 bytes, which was properly exported by FW (no extra data). pngcrush was able to shrink this file by almost 900 bytes to 8052 bytes by stripping a few extra unused data blocks and improving the image compression. Very cool.

                FW + pngcrush = killer combo.
                • 5. Re: 1x15px png = 1,262 bytes!  How do I strip exif/xmp     meta     data     on export?
                  Level 7
                  Great tip, Gerran!

                  --
                  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
                  ---

                  gerran wrote:
                  > If anyone else out there is having similar issues, I found a pretty nice tool
                  > on unix/mac to really shrink png files down:
                  >
                  > http://pngcrush.darwinports.com/ (mac install)
                  > http://pmt.sourceforge.net/pngcrush/ (unix/source install)
                  >
                  > pngcrush turned my 1,262 byte png file into a 97 byte png file. pngcrush can
                  > strip any unneeded data blocks from the png file and it will also optimize the
                  > compression of the image data. The result is a dramatically smaller file with
                  > no loss in image quality. The command line I use is:
                  >
                  > # pngcrush -brute -rem alla <input png> <output png>
                  >
                  > The "-rem alla" option tells it to strip all non-image data from the png and
                  > the "-brute" forces it to try over 100 different compression techniques to find
                  > the best one.
                  >
                  > I tried pngcrush on a larger png file that was 8936 bytes, which was properly
                  > exported by FW (no extra data). pngcrush was able to shrink this file by
                  > almost 900 bytes to 8052 bytes by stripping a few extra unused data blocks and
                  > improving the image compression. Very cool.
                  >
                  > FW + pngcrush = killer combo.
                  >