Announcement

Collapse
No announcement yet.

Batch conversion: color depth decreasing should be applied last

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

    Batch conversion: color depth decreasing should be applied last

    In batch conversion -> advanced, when you select both decreasing the color depth and changing brightness/contrast/gamma, the images will be converted to lower color depth earlier than the brightness/contrast/gamma changes are applied. Certainly needless to say, but this causes needless image quality loss, even a lot if the brightness/contrast/gamma changes are strong.

    The same kind of issue may exists with other conversion options as well; I didn't tried it. The a rule of thumb is that if you will decrease the color depth then do it as the very last step, but if you will increase color depth then do it as the very first step.

    (Yes, a workaround exists: doing the conversion in two steps. However most users will not realize from the look of the result that something went suboptimally, not mention realizing what exactly causes the poor quality.)

    #2
    OT: By the way, I don't see a conversion in two steps as a workaround. It should be the first thing to do, if
    dealing with two tasks to be performed, to know the best order of the two.

    You guessed right, there are some other threads about more than one function enabled in the batch conversion here.
    Dealing with the same issue : the conversion dialog suggests enabled functions performing simultaneously in one batch action,
    while of course there is a certain order of execution, as you have find out.

    I'm afraid this bug is very difficult to solve. It would mean a complicated finetuning of the batch-dialog,
    with all kinds of 'priority-rules' of each function if together with another one.
    0.6180339887
    Rest In Peace, Sam!

    Comment


      #3
      No, this (and many similar) bug is not that difficult to solve. Surely in theory the operations should be in a list where the user can move the items up and down manually, but the reality is that most users wouldn't not know what is the correct order anyway. Also, even if the user is a CG pro, it would be tiresome to set the order manually when it is obvious in the most cases. So even if IrfanView had a such feature, it should still make efforts to chose a sensible default order. (And especially it should make that effort now, since the list is not re-orderable by the user.) So, regardless of whether manual ordering is supported or not, the chosen operations of the convertion should be stored in a list internally (like, in a list of ImageOperation C++ objects (or whatever language it's this implemented in) that has an execute() method), that IrfanView should reorder be using some rules. Like the last rule you apply should be that color depth decreasing ImageOperation should be moved at the end of the list, and color depth increasing ImageOperation should be moved to the beginning of the list.

      (If on the top of this mechanism you want to allow manual ordering, that can be done without messing up anything. Simply, a checkbox saying "order operations manually" should be added in the Advanced batch window, and if that's checked, an "Edit order..." button should be enabled next to it. There you could see the list of all possible operations, with those that are not checked in gray (or better hidden), and you could have 4 buttons for moving selected item(s) up, down, top, and bottom. Also maybe a 5th convenience button that says "Apply automatic ordering rules". Then when the batch begins and "order operations manually" was checked, IrfanView should reorder the actual ImageOperation list to match this manual ordering instead of applying the automatic ordering rules on it.)
      Last edited by ddekany; 02.01.2008, 12:12 PM.

      Comment


        #4
        Let me rephrase myself : not 'difficult to solve' but 'quite some work to do'.
        0.6180339887
        Rest In Peace, Sam!

        Comment


          #5
          Strange that you say that... without the manual ordering stuff, I wouldn't think it's more than a few hours including testing and documenting, IF the programmer knows the source code well. Anyway, to be useful, here is a first version of the ordering rule, shown with an orderd list (just drop together in 5 minutes... but even this could improve things considerably better):

          1. Crop
          2. Color depth change that increases color depth
          3. Resizing that increases the number of pixels
          4. All operations that is not explicitly mentioned in this list
          5. Resizing that decreases the number of pixels
          6. Add overlay text
          7. Convert to greyscale
          8. Color depth change that decreases color depth

          Comment


            #6
            Of course one can reason together such an order.
            But I doubt that you checked all possible combinations in 5 minutes.
            0.6180339887
            Rest In Peace, Sam!

            Comment


              #7
              Well, don't believe me then, why should you after all. But anybody with a knowledge in computer graphic that could be called serious can reason this together pretty immediately, and without ever thinking about mathematical combinations (modulo stupid random mistakes... that I didn't made I hope ). It has nothing to do with trying combinations... you don't plan everyday things by trying the possible combinations of the steps, you just know that, like, you don't add the paprika-powder at beginning of the cooking, because then it will be bitter.

              Anyway, I hope the author(s?) will not find adding at least a little ordering (like this) to bee too challenging... Almost all kind of reasonable sorting should improve on a totally arbitrary (random) order, right?

              Comment


                #8
                Unless you want it to be bitter.
                Did I say that I prefer checking above reasoning in this case ?
                Your priority list is a nice set as a default. But there are always rare series possible.
                What if I first have to do a Vertical flip and then a non-center Crop?
                So I would prefer some manual control in this as well, to be able to affect the order.
                0.6180339887
                Rest In Peace, Sam!

                Comment


                  #9
                  Did I say that I prefer checking above reasoning in this case ?
                  Well, the usual way is first do reasoning, and then checking to see if it was right. Yeah, it's again that both can be checked, just the order matters...

                  Your priority list is a nice set as a default.
                  Except that I didn't really looked at the operations that I didn't mentioned explicitly in the list... and now that I do, I see that almost all of them should be after resizing to smaller size, not before it. AHEM... So, sorter-list second attempt (some other stuff fixed as well):
                  1. Crop
                  2. Color depth change that increases color depth
                  3. JPEG artifact removal (not supported)
                  4. Resizing that increases the number of pixels
                  5. Free rotate (not supported)
                  6. Resizing that decreases the number of pixels
                  7. Rotate 90/180/270, flip
                  8. I'm not very sure about the optimal order inside this group, but this will do:
                    1. Auto adjust colors
                    2. Color balance
                    3. Saturation
                    4. Brightness/contrast/gamma (I think this should be a single ImageOperation, that internally uses more-than-24-bit-per-pixel)
                  9. Sharpen/blur (blur not supported)
                  10. Bloom (not supported)
                  11. Add/remove noise (not supported)
                  12. Convert to greyscale
                  13. Negative
                  14. Things that are not really part of the photo/drawing or whatever it is:
                    1. Canvas settings (i.e., borders)
                    2. Add overlay text
                  15. Color depth change that decreases color depth


                  Also, for non-24 bit images, "increase color depth to 24 bits" and then converting back to the original color depth should be automatically done if things like sharpen, sturation, color balance and brightness/contrast/gamma are used.

                  I would prefer some manual control in this as well
                  Me too.
                  Last edited by ddekany; 07.01.2008, 06:27 AM.

                  Comment


                    #10
                    Also, for non-24 bit images, "increase color depth to 24 bits" and then converting back to the original color depth should be automatically done if things like sharpen, sturation, color balance and brightness/contrast/gamma are used.
                    Except that if the image is palette based, then it's not needed for sturation, color balance and brightness/contrast/gamma, as those can be just applied on the palette (assuming the palette is 24 bit). Converting to 24 bit is still needed for sharpen.

                    Also, automatically converting to 24 bit (and then later back to the original color deepth) is needed if there is resizing.
                    Last edited by ddekany; 07.01.2008, 03:32 PM.

                    Comment


                      #11
                      You're right. The 'Shift+G' options don't increase the color depth.
                      Sharpen unfortunately does automatically, if dealing with a 8 BPP.
                      I wouldn't fancy an automatic decrease back after the sharpen.
                      Because maybe I want to do some more editing, before bringing it back to its original resolution.
                      More functions have a auto-increase habit, like Auto adjust colors.
                      0.6180339887
                      Rest In Peace, Sam!

                      Comment


                        #12
                        Automatically decreasing the color depth back to the original is surely not needed if the output format doesn't supports palette (like JPEG). Converting back to the a lower color depth is surely needed if the output format is something like GIF. However, the user intent remains unclear in the case of PNG and TIFF output (among others), or even in the case of GIF if the original was less-than-256 color. But, I think the user most certainly means to keep the original color depth. And if he doesn't, he can still check "Change color depth" and select 24BPP there.

                        Comment


                          #13
                          Easier solution to batch conversion issue

                          Originally posted by ddekany View Post
                          In batch conversion -> advanced, when you select both decreasing the color depth and changing brightness/contrast/gamma, the images will be converted to lower color depth earlier than the brightness/contrast/gamma changes are applied. Certainly needless to say, but this causes needless image quality loss, even a lot if the brightness/contrast/gamma changes are strong.

                          The same kind of issue may exists with other conversion options as well; I didn't tried it. The a rule of thumb is that if you will decrease the color depth then do it as the very last step, but if you will increase color depth then do it as the very first step.

                          (Yes, a workaround exists: doing the conversion in two steps. However most users will not realize from the look of the result that something went suboptimally, not mention realizing what exactly causes the poor quality.)
                          I love IrfanView, but this inability to select order of operations is a serious shortcoming for a sizable chunk of what I do. My solution is very simple ... I use XnView for my batch processing. Below is a pic. of the options available with it. If IrfanView had this option (and a few other things I like better in XnView) I wouldn't need XnView at all.

                          Cheees!

                          "Never do today what you can put off until tomorrow" -- Bizarro Ben Franklin

                          Comment


                            #14
                            Batch conversion

                            I tried to use batch conversion for contrast and brightnes ONLY.
                            The output does NOT seams to have full effect. The Sharpen is always set to 1, Blur to 1 and Median to 1. tried to edit *.ini file manualy but it does NOT work.

                            I have to edit 800 jpg files (B/W) and I need only Contrast and Brightnes apply. Look like it has not applied set value at all. It is 4.20 version.
                            Same post has been placed in "bugs".

                            Comment


                              #15
                              Originally posted by halfozi View Post
                              I tried to use batch conversion for contrast and brightnes ONLY.
                              The output does NOT seams to have full effect. The Sharpen is always set to 1, Blur to 1 and Median to 1. tried to edit *.ini file manualy but it does NOT work.

                              I have to edit 800 jpg files (B/W) and I need only Contrast and Brightnes apply. Look like it has not applied set value at all. It is 4.20 version.
                              How do you know? It doesn't matter whether the boxes have values in them if the corresponding checkbox is not checked. Likewise, in the INI, if the setting has a 0, then it won't matter if the settings value is set because it won't be used. This should be true for both the settings you want and the ones you don't want. Is something else happening?

                              Comment

                              Working...
                              X