Announcement

Collapse
No announcement yet.

Resizing/Cropping & Saving PNGs with Transparency.

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

    Resizing/Cropping & Saving PNGs with Transparency.

    I love IrfanView. But one thing I've never been able to figure out is how to simply resize or crop a PNG image and then save it with the same properties (just resized/cropped). Every time I try to edit a PNG with transparent background, it always saves it with a color in the background. I've tried all the different Save options, but I get the same result.

    What is the best way to approach this in Irfanview? I usually don't want to change any properties of an image I'm trying to resize except for the dimensions.

    Thanks in advance.

    #2
    It sounds like you're saving transparency using the IrfanView window colour. Disable that, and pick the transparent colour when saving.
    Attached Files
    Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      Originally posted by Bhikkhu Pesala View Post
      It sounds like you're saving transparency using the IrfanView window colour. Disable that, and pick the transparent colour when saving.
      Thanks!

      So, after I click "Save" with those settings configured, it pops up with a box that asks me to "Click in the image to set the transparent color...."

      Click image for larger version

Name:	2016-06-16 01_22_44-Choose transparent color.png
Views:	1
Size:	47.1 KB
ID:	81421

      What am I supposed to click if I just want it to keep the transparency like it is? Or am I supposed to Pres ESC?

      Comment


        #4
        When I click "Esc" it doesn't keep the background transparent; it makes the background black.

        When I click the black background, it keeps the background transparent, but ends up distorting the image pretty severely:

        Click image for larger version

Name:	ZvmYvrc.png
Views:	1
Size:	24.9 KB
ID:	81422

        What is going on?

        Comment


          #5
          I think you should use a program that supports 32-bit alpha transparency. IrfanView can only save one colour as transparent. Resizing may be the cause of the artefacts.
          Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

          Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

          Comment


            #6
            Oh okay. So you're saying that I can't really use IrfanView to just resize a PNG image with transparent background like this one?

            Click image for larger version

Name:	the-credit-pros-logo-shadow 600x129.png
Views:	1
Size:	41.2 KB
ID:	81423

            Comment


              #7
              IrfanView is not up to the job. I used Serif PhotoPlus X8 to resize the attached images. The 32-bit colour depth is retained.
              Attached Files
              Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

              Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

              Comment


                #8
                Okay, thanks so much for the replies! I've been wondering for years, "What am I doing wrong here?" lol

                Comment


                  #9
                  Hi people,
                  I think that's "one color transparency" not the whole truth ...
                  Irfanview really displays only one color in the background, but if image contains transparency/alpha channel, then background color blended with this.

                  Click image for larger version

Name:	TransparencyTest.png
Views:	1
Size:	150.0 KB
ID:	81426
                  This is original created by old PaintShopPro 8 (24-bit color + 8-bit transparency) - (try download and show in Irfanview)

                  Click image for larger version

Name:	IrfanView-Transparency.png
Views:	1
Size:	127.2 KB
ID:	81427
                  This is Irfanview screenshot (when "Main window color" = background, is set to orange)

                  If Irfanview actually display only singlecolor (1-bit) transparency, then result should look something like this:
                  Click image for larger version

Name:	TransparencyTest1bit.png
Views:	1
Size:	150.1 KB
ID:	81428
                  1-bit transparency with dithering (try download and show in Irfanview)

                  or
                  Click image for larger version

Name:	TransparencyTest1bi-Nodither.png
Views:	1
Size:	78.0 KB
ID:	81429
                  1-bit transparency no dithering (try download and show in Irfanview)

                  Note: In fullscreen (even if Main window color is set to orange), when try view this image one by one, then background color shift to black. When try view this three test images in window mode (or close and open Irfanview in fulscreen), this display OK.

                  The situation is such that Irfanview is able to display multibit transparency (though probably not 16-bit/channel?), but can not save it back. This annoying problem is certainly the PNG and ICO (which Irfanview also does not allow save semitransparent areas). The question is only: whether it's a bug or "features"?
                  Last edited by toxman; 16.06.2016, 04:30 PM.

                  Comment


                    #10
                    I cannot agree that Irfanview is unsuitable for this sort of work but you undoubtedly can get better results from more specialised software.

                    I made an enlarged and a reduced version of your logo with Irfanview and have put them onto a background using the Insert Overlay/Watermark Image function from the Edit menu. That is attached below as well as some of the settings menus I used. The top logo is your original size, with the larger and smaller versions below it. The bottom one is your image from post #4 which you describe as distorted. It appears to be much the same size as your original logo but with different colors. I am not sure how you got there.

                    For opening and saving transparent PNG images I prefer to set a distinctive Main window color in the Properties/settings dialog from the Options menu. Choose a color that you are sure is not present in your logo and Check the top option in that Viewing tab to Show the Transparent Color for PNG files (i.e. Show the Main window color through the transparent area). That way you can check Use Main Window color in the PNG save options and not have to bother with clicking the image to identify the area to be tagged as transparent.

                    Your original logo image that you attached in #1 has a lot of distinct colors according to the Image information dialog, more than I imagine were present when it was created. I decided to reduce the number to 256 using Decrease Color Depth from the Image menu. When you change size you have to choose Resize rather than Resample because Resample will create a lot more colors again to make edges appear smoother. The penalty of doing that is, where the transition colors are will no longer be part of the Transparent area when you save the result. So you have to accept a slightly jagged edge to the resized logos either way especially if you are enlarging it. No way around that I know of except to do a bit of manual editing if there are some jags you find offensive, like those at tops and bottoms of loops.
                    Attached Files

                    Comment


                      #11
                      Originally posted by Mij View Post
                      I cannot agree that Irfanview is unsuitable for this sort of work but you undoubtedly can get better results from more specialised software.
                      There is no doubt about it, using a more appropriate software that supports 32-bit is not only a lot easier, it produces results without jaggies.

                      There's no reason not to use another program when there are free or inexpensive options out there. IrfanView is €10 for commercial use so spending £20 on PhotoPlus X7 for this job is not an issue for someone who needs to do commercial work like this Logo. No doubt there are other options, but that's what I use for enlarging program icons, etc.
                      Attached Files
                      Last edited by Bhikkhu Pesala; 17.06.2016, 05:16 PM.
                      Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

                      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                      Comment

                      Working...
                      X