Announcement

Collapse
No announcement yet.

Image Resize/Resample Filters Have Errors

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

    no bug Image Resize/Resample Filters Have Errors

    A fellow Irfanview user pointed this out to me.

    Irfanview's filters have errors in how the algorithms are run. For example, the Lanczos filter doesn't follow its algorithm properly. This results in undesirable moire effects, and I believe there's a one-pixel border problem as well. A screenshot is attached with a side-by-side example of what Irfanview does, versus a proper Lanczos filter.



    The easiest place to see where Irfanview breaks it is on the slats of the house to the far left. Notice the moire effects there. Even the lighthouse bricks appear unusually pixelated in nature.

    This is not my area of expertise, so I have invited the user who pointed this out to me to chime in and explain what needs to be done to correct this (his name is Jutt). I hope it will be fixed, however, because I like using Irfanview for resampling as it is more lightweight than most horrendously large editors like Photoshop.

    Thanks!

    - Trickster

    #2
    Are you downsampling or upsampling? The Lanczos3 filter is not used for downsampling. If you need that, use the RIOT plugin.
    Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      Hello,

      As Trickster mentioned we discussed the resampling functions of Irfanview, and I showed the above picture as example of the "faulty" Lanczos interpolation. It is indeed a downsampled image though, and if Irfanview does not use Lanczos for downsampling, my conclusion was at least partially invalid. I followed your suggestion and looked at the Riot plugin (took me quite a while to figure out it was called "save for web" in Irfanview) and that does seem to have a good Lanczos implementation.

      I had some other comments about Irfanview's default resampling functions, but before I post those, could you tell me what filter is used instead when downsampling an image?

      Comment


        #4
        Clearly, this is not a bug, because the Lanczos3 filter is not being used for the results that you showed.

        Downsampling uses a built-in filter, not any of those on the Resample filter drop list.
        Before you post ... Edit your profile • IrfanView 4.67 • Windows 10 Home 19045.2486

        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

        Comment


          #5
          Yes, I'm sorry I didn't notice that downsampling doesn't support any of the listed filters. Only now I noticed It says so in the interface—makes me feel kind of stupid.
          To be quite honest though, from a design point of view, I'm slightly puzzled why you wouldn't support all these filters for downsampling. It's not exactly rocket science to implement them properly.

          Anyway, there are two more things that bugged me. The first one, when you look at the above lighthouse image scaled with Irfanview's "built-in" filter, the top half of the image seems to have a slight sub-pixel shift upwards. The bottom half does line up perfectly with the Lanczos comparison.

          The second thing is that when upsampling (using any resample filter), the scale factor seems to be somewhat off. For example if I double a 100x100 image, the dimensions get doubled properly to 200x200. But the pixel data is scaled with a slightly different factor, something like 199/99, and ends up a bit stretched outwards at the corners of the image.

          The second one may be just a matter of personal preference on how scale factors should work. Also I don't know how the built in downsampling algorithm is supposed to work, to say with certainty that the first issue really is a bug.

          Comment


            #6
            To chime in with Jutt, I always assumed I was using Lanczos3 when downscaling (I see the note there above it now), and I am disappointed that the default method is bad. Despite the note, this is misleading because the option can be selected and changed when you are downscaling even though it does not apply. Also, there is no option you can select for downscaling. Why apply the sampling function only in one direction?

            Since I always install the plugins package, does this mean that it automatically uses a better downscale function, or do I need to do something special not included in the plugins package?

            I'm also interested in getting the best picture quality when IV resizes an image to fit to the screen without modifying the image file. Is it using a good downscale function in this case, or does it just use the same function it would use to downscale the image if it were being resized?

            Is there some options window I'm not finding that has this information in it?

            Thanks for your time.

            Trickster

            Comment


              #7
              Originally posted by Trickster View Post
              Despite the note, this is misleading because the option can be selected and changed when you are downscaling even though it does not apply.
              Since it clearly says (enlarging only) it is obviously not misleading.

              After selecting the resampling method the scale factor can be changed to 200% or whatever. Disabling the drop list if the scale factor is less than 100% would make the dialogue less convenient to use.

              I suspect that resample while zooming uses the same built-in algorithm for speed. Try zooming in with different resampling methods selected — slowest and fastest. There is no difference. There would be a big difference otherwise. Also look at the results.

              If you want a choice of resampling methods for downsampling, then just use the "Save for web" option. Why not use the functions of the program that are provided instead of complaining that there is no option.

              Do remember that this is an image viewer, not a photo-editing program. Its priority is for speed since no changes are made to the images while just viewing them. There would be no point wasting extra time on resampling to zoom, since those changes will be lost on the next keyboard press.
              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