Announcement

Collapse
No announcement yet.

png transparency always lost

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    png transparency always lost

    hey,
    i'm sorry if this has been brought up before. i've searched and found several topics concerning around this but none really solved my problem, so i thought i should open a new thread after all.

    i have an image with indexed colour of which 161 are unique colours. i am editing it in photoshop. it also has a transparent colour.
    when i open the psd in irfanview, the transparency is replaced with white. when i save it as gif, the transparency again turns into white. opening the same gif in photoshop will show the transparency fine though. when i save the psd as png, the background in irfan is no longer white but black. i'm presuming that's because it interprets transparency correctly now? (is there any way to enable a checkerboard for transparency like in photoshop?)
    i've noticed in photoshop, you cannot change between the 1-9 levels that irfan offers for png compression. (what are the differences here anyway? png is lossless, right? so what's the difference?)
    therefore, i wanted to save the photoshop png as an irfan png with compression set to 9 in order to save filesize. (every kb counts for me in this case)
    it comes up with a dialog to select the transparent colour. something i don't understand. doesn't it already interpret transparency correctly? why must i reassign it now? in the dialog it shows the transparent colour as black. of course i cannot key this out as my image contains regular black colour in places.

    thanks a lot for your support.

    #2
    IrfanView unfortunately doesn't use a checkerboard for the transparency.
    It uses the color set in the Properties/Viewing dialog as the 'Main window color'.
    So in order to get a clear distinction, it's better to have this color not set as black, but as some 'odd' color.

    If the source file already has a defined transparent color, one can disable the selection of transparency in the PNG dialog. Otherwise you have to pick some pixel before saving.

    Afaik the 1-9 levels have more to do with the speed of decompressing the file to show it, than with filesize.
    0.6180339887
    Rest In Peace, Sam!

    Comment


      #3
      A quicker solution than PNGOUT, and one that doesn't require loading the image in IrfanView is to use pngcrush from Sourcefourge.

      Download the ZIP file and extract to a suitable folder — say C:\Program Files\pngcrush\ and rename the executable if you wish as I did to pngcrush.exe.

      From the Tools menu of Control Panel, select Folder Options, File Types, and scroll down to the PNG file type. Click on Advanced, and add a new action called "Crush." In the field "Application used to perform action" enter the path to pngcrush.exe like this:

      "C:\Program Files\pngcrush\pngcrush.exe" -e 2.png "%1"

      The parameter -e 2.png will append "2" to the current file name. The new action will now be added to the Windows Explorer shell menu whenever a PNG file is selected.

      Off-topic discussion split off to Compressing PNG Images in the Software Forum.
      Attached Files
      Last edited by Bhikkhu Pesala; 29.06.2008, 06:03 PM.
      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

      Comment


        #4
        Decompression speed and ratio depend mostly on the chosen preprocessor filter.

        Comment


          #5
          okay, thanks for the replies guys. i understand this better now.
          however, i came across another problem.

          how can you save the transparency channel when resizing an image? i take it through resampling, the transparency is lost? is there any way to prevent this?

          the image is still 161 colours (+ transparency) and originally about 2500x1800px. i would like to reduce it to 680px in width. my idea was to set to rgb, resize, set back to indexed colour (reduce colours) using the steinberg floyd dithering irfan offers. good idea?
          my problem now is the loss of the transparency.

          how can this be done?
          also when i leave it at rgb, the transparency will be lost, unfortunately =/
          i understand when resizing, it mixes the colours together to create the smaller image. but can't it mix in transparency as well?
          Last edited by posix; 10.07.2008, 03:57 PM.

          Comment


            #6
            Version 4.28 (Release date: 2010-12-16)
            • New PNG save option: Save transparency as Alpha channel (Thanks to Thomas Henlich)

            Comment


              #7
              In my case "Save transparency as Alpha channel" doesn't sovle the problem.

              I've export file from InkScape as PNG with transparent background (or maybe better to say - no background).

              When I've open it in Photoshop...it shows properly the graphic on 'transparent' background (no background).

              When I open this graphic in IrfanView — i'm not sure is it shows transparency. The background is black (?).

              Now. Then I use "Save" in IrfanView menu and then open it in Photoshop and....now there's no transparent background like befor, the background is black :/

              I've try to use "Save as" dialog in IrfanView, but in option there's only "set color..." options. But I don't want to set transparency color. Transparency is already there (without any color). Now it's tell me to choose transparency color from my image. My image have black and red colors and irfanview set background to black...so what should I choose :/

              I don't want to choose any transparent color I just want to save with transparency that is already in that png file...can I do it with irfanvew ?

              Comment


                #8
                Change your main window colour from black to white or something else to suit your image.
                Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                Comment


                  #9
                  And do that every time I have new PNG, first checking what colors my image use and what doesn't ?

                  PS
                  I've open it in standard Windows XP image viewer and then just simply "Save" and ... it doesn't loose transparency.
                  Last edited by Rhotax; 13.07.2015, 10:37 PM.

                  Comment


                    #10
                    Either that or use an editor that supports 32-bit alpha properly.

                    Open any 32-bit image and inspect the Image Information dialogue.
                    Attached Files
                    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                    Comment

                    Working...
                    X