Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Reduce size of PNG with minimal quality loss

$
0
0
You might want to try and disable MagickNET.OpenCL, that is the only thing that could affect the Quality. You will probably get a better result without it. And the Quality property for PNG does not work how you think it does. Here is an explanation:
/* Untangle the "-quality" setting:

     Undefined is 0; the default is used.
     Default is 75

     10's digit:

        0 or omitted: Use Z_HUFFMAN_ONLY strategy with the
           zlib default compression level

        1-9: the zlib compression level

     1's digit:

        0-4: the PNG filter method

        5:   libpng adaptive filtering if compression level > 5
             libpng filter type "none" if compression level <= 5
                or if image is grayscale or palette

        6:   libpng adaptive filtering

        7:   "LOCO" filtering (intrapixel differing) if writing
             a MNG, otherwise "none".  Did not work in IM-6.7.0-9
             and earlier because of a missing "else".

        8:   Z_RLE strategy (or Z_HUFFMAN_ONLY if quality < 10), adaptive
             filtering. Unused prior to IM-6.7.0-10, was same as 6

        9:   Z_RLE strategy (or Z_HUFFMAN_ONLY if quality < 10), no PNG filters
             Unused prior to IM-6.7.0-10, was same as 6

    Note that using the -quality option, not all combinations of
    PNG filter type, zlib compression level, and zlib compression
    strategy are possible.  This will be addressed soon in a
    release that accomodates "-define png:compression-strategy", etc.

   */
And an answer to your other question are:

1: That is correct but that only works if your source image also has a color profile. In the next version of Magick.NET I have added the following new method to make this easier:
///<summary>///  Transforms the image from the colorspace of the source profile to the target profile. The///  source profile will only be used if the image does not contain a color profile. Nothing///  will happen if the source profile has a different colorspace then that of the image.///</summary>///<param name="source">The source color profile.</param>///<param name="target">The target color profile</param>publicvoid TransformColorSpace(ColorProfile source, ColorProfile target)
2: You can use image.GetAttribute("icc:description") for this but I will try to see if I can add this to the color profile class.

Viewing all articles
Browse latest Browse all 3693

Trending Articles