Announcement

Collapse
No announcement yet.

Reduce size of jpg - No quality loss in selected area - Lower quality on other areas

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

    Requested Reduce size of jpg - No quality loss in selected area - Lower quality on other areas

    I use mainly IV for viewing, and in batch mode, for renaming the pictures with meaningful names.

    Often I would like to reduce the size, but keep the high quality definition of the main subject, while decreasing the quality of surrounding, especially if it has no artistic value or is not scenic.

    I have read in Wikipedia how a picture is encoded and understood the few steps:
    - Color space transformation,
    - Down-sampling
    - Block splitting
    - Discrete cosine transform
    - Quantization
    - Entropy coding (compress)

    The principle to avoid further loss of quality is to keep the data of each block after "Quantization" unchanged.

    The steps could be:
    - Load file
    - Uncompress
    - Restore data of each block (B matrix in Wikipedia) and keep it
    - Continue process of recreating image
    - Display image

    - Change quality of some areas (this action can be repeated)
    -- The user selects (polygon) an area
    -- The software automatically selects full blocks corresponding to the one stored in the file.
    -- The user defines a down-sampling for this area (can be horizontal, vertical or both directions)
    -- The modified blocks are marked

    - When saving is requested do for all marked modified blocks
    -- Color space transformation
    -- (No need for further down-sampling)
    -- Discrete cosine transform
    -- Quantization

    After this operation, blocks have been modified, but blocks with no changes to the image will not be changed, thus leading to no further loss of quality to those ones.

    - Compress
    - Save file

    The explanation may look long as I want to make sure that the request is well understood.

    This function has following advantages:
    - keep untouched the quality of picture of the main subject of the photo as delivered by the camera,
    - reduce the quality (or sharpness) of secondary zone of the photo
    - reduce the size of the file, without loss of viewer's satisfaction.

    Thank you.

    #2
    This may be something for a separate tool or a plugin but much too much for a viewer.
    Not so easy to design a UI which users will understand if they do not have an idea about the internals of jpeg, quantization and so on.

    If you really understood what these aspects mean - just from reading an article in Wikipedia - then you should be able to write such a tool. Or talk with the guys maintaining libjpeg.

    Comment


      #3
      Surely this function could be a separate plugin. On the other hand I disagree that IV is only a viewer when I see all the possible image treatments in the menu "Images"

      The point of previous post was not well understood:
      1. Purpose
      Firstly, confirm that I understand that jpg is a compression with losses.
      Secondly, that some image treatment may be possible containing the losses to the parts on the picture that has not been treated. I have exposed the idea in detail so that it can be confirmed or rejected because not possible already from the theoretical point of view. It is an idea and if users are interested, I hope that someone will pick it.

      2. I don't pretend to understand all the aspects, but I don't feel stupid and I think that I can understand what I read. No doubt, I cannot write such a tool. In the past I used to program automation system and even if writing a function was generally fast, making it work in a complex environment required a large experience and technical knowledge to let it interact with the "outside world".

      The idea is there, open for challenge. I leave it to persons familiar with image processing to pick it or to leave it, or to transfer it to other members of this developers community.

      Comment


        #4
        Hi,

        maybe this is a point you should contact Irfan directly and / or ask the developer of the riot.dll (Save for web plugin).

        Regards
        Nils

        Comment

        Working...
        X