Announcement

Collapse
No announcement yet.

Streamline lossless cropping

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

    Requested Streamline lossless cropping

    Hi! Thank you for making this great software and keeping it free.

    I would like to see improved lossless cropping support, perhaps something similar to BetterJpeg:

    1) When you make your cropping selection, you don't see the result until you save the cropped file and open it (the result is different because of JPEG grid limitations of course). Too many steps involved. Can you make the selection snap to acceptable borders immediately, prior to saving?

    2) The "save as" dialog is not required immediately after you select lossless crop. Why not allow the user to do whatever other changes he wants to make and then choose to save?

    Here are the interface steps I personally would prefer for lossless cropping:
    1) Draw rectangle to select
    2) Right click selection, choose Lossless Crop
    3) Save the cropped image later, whenever you feel like it.

    Please feel free to pitch in ideas .

    #2
    Originally posted by Knocks View Post
    2) The "save as" dialog is not required immediately after you select lossless crop. Why not allow the user to do whatever other changes he wants to make and then choose to save?
    Why, what would you need to do with it first that is lossless? Another cropping?

    Comment


      #3
      Many things, for example crop, then resize. Can't know what to resize to until you get a cropped image.

      Comment


        #4
        Originally posted by Knocks View Post
        Many things, for example crop, then resize. Can't know what to resize to until you get a cropped image.
        Maybe I'm missing something, but how could you do a resize? That isn't a lossless operation. You would be defeating the purpose of lossless cropping. If you are going to radically change the image, then you can use normal crop.

        Comment


          #5
          You could possibly combine crop and rotate as lossless operations. Like Skippybox I cannot see what else you could combine losslessly.

          Comment


            #6
            I never said resize was lossless. Lossless crop, then (lossy) resize, then save. You only lose quality once. You're suggesting lossy crop, then lossy resize?

            Comment


              #7
              Originally posted by Knocks View Post
              I never said resize was lossless. Lossless crop, then (lossy) resize, then save. You only lose quality once. You're suggesting lossy crop, then lossy resize?
              Crop isn't lossy unless you save it with compression again. You are planning on saving (recompressing) it after resizing, so why not use crop? Lossless crop is good if you're not editing, because it does not recompress. That is why the image is quickly saved because there isn't much you can do losslessly with the image afterwards. Crop is no better than lossless crop in your situation, because you are not losing quality between the cropping and the resizing through compression.

              Now, if you were to crop, save, then resize and save, it is a different story. Then you would be losing quality in the recompression. If you need to split tasks like that then a lossless crop/save would help before resizing and resaving. But, you asked for delayed saving of a losslessly cropped image. That suggests that you are doing everything in one session.

              Lossless crop is not really any more special than regular crop. It just uses an algorithm to preserve the compressed data structure of the original file and makes sure the selection is properly aligned to do so. Whether you used one or the other, the resultant pixels should be the same in memory. Normal crop does not destroy the actual pixels if not properly aligned, but would destroy the compressed data structure from being reused. If you saved the image in a lossless format afterwards, you really haven't lost anything.

              To worry about the quality of lossy compressed images is silly. Even lossless isn't absolutely lossless (notice it's not lossproof!). There is error in all stages of processing, even variance between different programs.
              Last edited by Skippybox; 19.02.2009, 08:09 PM.

              Comment


                #8
                You are missing the point. I know what cropping and lossless cropping do. I was suggesting to streamline the interface, which currently contains a lot of unnecessary steps. See 1) and 2) in the original post.

                Comment


                  #9
                  Precisely my point, you don't need to use lossless crop when crop is the same or better. I didn't say #1 isn't a good idea.

                  Mij, maybe you can explain it better?

                  Comment


                    #10
                    Your explanation makes sense, but it does not cover all scenarios. Many users prefer the freedom to resize or not to resize (or conduct any other operation) after the lossless crop, without having to find the newly saved file.

                    I work with a lot of slightly oversized images where the result has to have a specific pixel width. All of them need to be pre-cropped, and depending on the results of the crop, I may or may not need to resize. Ideally, I will do a lossless crop and preserve the original quality, but sometimes I have to resize as well. You can download a trial version of BetterJpeg and play around with the crop function to get the idea of how the interface works.

                    Slightly off topic, what do you think of a hybrid lossless/lossy crop function? Can the few pixels that don't snap precisely to the grid be recompressed with the rest of the image preserved?

                    Comment


                      #11
                      Hello Knocks,

                      I didn't cover all scenarios because not all scenarios require lossless. I do understand your situation, that you want to "test" lossless and see if it works. It does sound valid to try and do it lossless first before going lossy. However, it isn't difficult locating the new file. If "_crop" is appended to the name in the original folder, then pressing F5 and Space will give you the new file. Plus, if the containing folder is open in Windows Explorer, the new images will appear at the bottom of the list for easy access.

                      But really it isn't necessary to examine the file. Now, obviously I don't know what you are cropping exactly. Still, if you follow the "16px" rule, you should be able to see the exact area in the selection. It is most important that you work in 1:1 for selection/cropping accuracy, though. Don't forget about Custom selection (SHIFT+C) and Save values. You can make an initial selection and adjust it with those tools before cropping. If you can't make it work, you should be able to tell and switch to regular crop. If the "16px" is giving you trouble then use a chart of values, like attached.

                      Hybrid lossless/lossy crop function? Actually, I think that lossless crop does that already. Notice that it will move the chosen coordinates if invalid, but accepts nearly any width/height. Therefore, it must be recompressing the extra pixels out of range. Try testing the before and after images in a layer editing program to examine the difference.

                      But, like I said, crop is not lossy if it isn't lossy compressed. And you aren't because you are immediately resizing. If you weren't, you could use PNG or something. Really, it isn't much to worry about because just decompressing the JPG image is a loss, right? And why worry about any of it when resize will change all your pixels anyway? Crop is the least of your problems. I don't know what images you are working with, but if it is so important, why aren't you starting with a lossless format, like BMP, TIFF, PNG, or RAW? And why not use BetterJpeg if it is better?!

                      JPEGCrops
                      Jpegcrop
                      Attached Files

                      Comment


                        #12
                        Terminology confusion?

                        I think part of the problem is the term "lossless crop". The term implies that the "loss" in normal crop comes from the crop operation, which isn't true. As I understand "normal" cropping, a
                        1. JPG read and decompressed to a matrix of bits
                        2. Image is cropped by deleting rows and columns in the matrix
                        3. Matrix is compressed and saved
                        Only the last step introduces any losses.

                        As I understand it, "lossless" cropping takes advantage of how JPG compression works. JPG breaks an image into rectangular blocks which are then compressed. Lossless cropping works by selecting the blocks within the crop boundaries. That is:
                        1. JPG read and saved to a matrix of blocks (without decompression)
                        2. Image is cropped by deleting rows and columns in the matrix
                        3. Matrix is saved as a new JPG file (without recompression)

                        JPG blocks can also be rotated 90 degrees and/or flipped without being decompressed. Any other operation (resize, color adjustment, rotate by other than a multiple of 90 degrees) requires decompression and recompression. Recompression introduces losses.

                        So if you opened a JPG, cropped it and saved it in a lossless format like BMP, you should be the same result whether you used "lossless crop" or "lossy crop". In reality, there would be small differences because the "lossless crop" has to round the crop boundaries to match the JPG block boundaries.

                        Also, if you opened a JPG, cropped it, resized it, and saved it as a JPG, you should be the same result whether you used "lossless crop" or "lossy crop".

                        Comment


                          #13
                          I don't think anyone disagrees that quality loss occurs during recompression, not cropping itself. Where is the confusion? I only suggested that the program leaves you alone after cropping instead of forcing you to save (and explained why).

                          Regarding BetterJpeg, it's just not smart to pay $30 for a function that can be implemented in Microsoft Paint with a free library.

                          Comment


                            #14
                            Is there perhaps a misunderstanding here?
                            AFAIK after a lossless operation, be it crop or otherwise, the file is always saved immediately and automatically as part of the process.
                            You do not need to save the image again. In fact, if you do, you defeat the whole purpose of the lossless operation, since the displayed image on screen is uncompressed and saving that would re-compress with losses.

                            Comment


                              #15
                              Thanks Mij and cwb3106 for explaining it so eloquently. You see Knocks, you just can't keep editing an image that hasn't been decompressed. It must be promptly resaved to finish the special operation. Besides, the normal save function cannot accomodate compressed files, only the lossless plugin. Save can only use decompressed files in memory.

                              Maybe what you are really asking for is an option to open your new file immediately after saving?

                              Comment

                              Working...
                              X