5 Replies Latest reply: May 9, 2013 10:18 AM by Art(sic) RSS

    I want to delete all transparent pixels, how can I? CS6

    Art(sic) Community Member

      I would like to delete all transparent pixels surrounding my irregularly (non-square) image.  The TRIM function only trims to a square surrounding my image and not to the edge of the image itself.  Is there a work around for this?  I have looked around and haven't found one. 

       

      Thanks,

       

      JB

        • 1. Re: I want to delete all transparent pixels, how can I? CS6
          JJMack MVP

          Image have rectangular area they have a width and height boundaries as do layer.  Not all of the rectangular area need to have content or be fully opaque,  However the image boundary is a rectangle.  Some file formats are like a Photoshop Background layer do not support empty area or even transparency so those file formats only contain image that are rectangles and have no transparency. Some file formats support transparency and empty areas so those images can be any shape and contain transparency still the image boundary is rectangular. Then there is the GIF file format an oddball format. It only supports 256 Colors. Pixels are mapped to one of the 256 colors selected for the image.  If you want Transparency in a gif  the number of colors is reduced by 1 to 255  the 256 color now indicate no content its not real transparency it just a no color pixel in other words off or no content.

           

          So if you have areas that are 100% transparent there is nothing to delete the area is empty.  If you have pixels that contain some transparency and you delete those pixels you delete details are you sure you want to delete all pixels that contain transparency? You will loose things like drop shadows

          • 2. Re: I want to delete all transparent pixels, how can I? CS6
            R_Kelly Community Member

            Image pixels are square so you won't be able delete the "transparent pixels" up to the edge of a non square image.

             

            What you can do is save the image in a format that supports transparency such as png, tiff or psd.

             

            Do you have a specific use for the image in mind?

            • 3. Re: I want to delete all transparent pixels, how can I? CS6
              Art(sic) Community Member

              Thanks for your response, R_Kelly.  Yes, I have saved the image as a PNG.  The pixels being transparent isn't really the issue, it's the remaining bounding box of the transparent pixels that is causing the trouble.  I am using the irregularly sized image as a button on a web page.  It is in close proximity to another button.  When I place them as I want them, the bounding box of the image overlaps with the other button image and it causes the hover and click functions to be confusing and tricky to use.

               

              Does this make sense?

              • 4. Re: I want to delete all transparent pixels, how can I? CS6
                JJMack MVP

                In that case create both button in a single image file that you slice it up.  I do not do web pages but know the many a navigation bar has been built using slices. However I do not know how irregular you can get without upsetting your system. Since slices are images their bounds will be rectangles. I know little about HTML mouse overs however all I have ever seen in html for images has been width height frame and alignment never seen anything having to do with shape.

                • 5. Re: I want to delete all transparent pixels, how can I? CS6
                  Art(sic) Community Member

                  Thanks very much JJMack.  That was just the trick indeed.  I sliced the image and set the unwanted area slice to "None" from the crtl+click menu pop-up.  When I saved as a PNG-24 it saved it as component slices which I reassembled minus the unwanted slice.  Not perfect, but very close.

                   

                  Thanks again.