image optimizer for web

apng compression has no effect on v1 with some files but with v0.99 ok

megalol said, on 24/06/2022
sample: Can't post here coz it's NSFW file?
command: pingo.exe -auto=20 -noconversion 2.png

Image:
  Filename: 2.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 760x548+0+0
  Units: Undefined
  Colorspace: sRGB
  Type: PaletteAlpha
  Base type: Undefined
  Endianness: Undefined
  Depth: 8-bit
  Channel depth:
    Red: 8-bit
    Green: 8-bit
    Blue: 8-bit
    Alpha: 8-bit
  Channel statistics:
    Pixels: 416480
    Red:
      min: 0  (0)
      max: 255 (1)
      mean: 117.43 (0.46052)
      median: 0 (0)
      standard deviation: 90.363 (0.35437)
      kurtosis: -1.4768
      skewness: -0.059153
      entropy: 0.77934
    Green:
      min: 0  (0)
      max: 255 (1)
      mean: 48.201 (0.18902)
      median: 0 (0)
      standard deviation: 53.139 (0.20839)
      kurtosis: -0.62353
      skewness: 0.74195
      entropy: 0.76432
    Blue:
      min: 0  (0)
      max: 254 (0.99608)
      mean: 44.994 (0.17645)
      median: 0 (0)
      standard deviation: 49.925 (0.19578)
      kurtosis: -0.44716
      skewness: 0.78935
      entropy: 0.77141
    Alpha:
      min: 0  (0)
      max: 255 (1)
      mean: 185.31 (0.72671)
      median: 0 (0)
      standard deviation: 113.37 (0.44458)
      kurtosis: -0.95952
      skewness: -1.018
      entropy: 0.31868
  Image statistics:
    Overall:
      min: 0  (0)
      max: 255 (1)
      mean: 98.984 (0.38817)
      median: 0 (0)
      standard deviation: 76.699 (0.30078)
      kurtosis: -1.309
      skewness: 0.50474
      entropy: 0.65844
  Alpha: none   #00000000
  Colors: 96
  Histogram:
        112755: (0,0,0,0) #00000000 none
           579: (0,0,0,227) #000000E3 srgba(0,0,0,0.8902)
           491: (0,0,0,34) #00000022 srgba(0,0,0,0.13333)
           406: (0,0,0,78) #0000004E srgba(0,0,0,0.30588)
           400: (0,0,0,184) #000000B8 srgba(0,0,0,0.72157)
           334: (0,0,0,140) #0000008C srgba(0,0,0,0.54902)
          2861: (6,1,1,252) #060101FC srgba(6,1,1,0.98824)
           988: (34,10,9,255) #220A09FF srgba(34,10,9,1)
          6397: (54,2,1,255) #360201FF srgba(54,2,1,1)
          9533: (64,3,3,255) #400303FF srgba(64,3,3,1)
          8950: (73,6,5,255) #490605FF srgba(73,6,5,1)
          6689: (79,12,10,255) #4F0C0AFF srgba(79,12,10,1)
          8418: (82,4,5,255) #520405FF srgba(82,4,5,1)
          5844: (87,16,15,255) #57100FFF srgba(87,16,15,1)
           918: (88,4,5,255) #580405FF srgba(88,4,5,1)
          8044: (94,5,6,255) #5E0506FF srgba(94,5,6,1)
           227: (94,24,22,255) #5E1816FF srgba(94,24,22,1)
          5037: (97,18,16,255) #611210FF srgba(97,18,16,1)
         15066: (101,5,6,255) #650506FF srgba(101,5,6,1)
             1: (101,30,27,255) #651E1BFF srgba(101,30,27,1)
            74: (106,21,19,255) #6A1513FF srgba(106,21,19,1)
          8002: (107,8,9,255) #6B0809FF srgba(107,8,9,1)
          4577: (109,23,21,255) #6D1715FF srgba(109,23,21,1)
          3715: (110,36,33,255) #6E2421FF srgba(110,36,33,1)
          7943: (118,19,16,255) #761310FF srgba(118,19,16,1)
          3321: (125,47,43,255) #7D2F2BFF srgba(125,47,43,1)
          5589: (126,30,27,255) #7E1E1BFF srgba(126,30,27,1)
          5152: (130,25,22,255) #821916FF srgba(130,25,22,1)
            53: (136,57,51,255) #883933FF srgba(136,57,51,1)
          5328: (138,39,35,255) #8A2723FF srgba(138,39,35,1)
             1: (142,42,37,255) #8E2A25FF srgba(142,42,37,1)
            82: (143,30,26,255) #8F1E1AFF srgba(143,30,26,1)
          3302: (144,63,57,255) #903F39FF srgba(144,63,57,1)
          4770: (148,33,29,255) #94211DFF srgba(148,33,29,1)
          4587: (149,47,42,255) #952F2AFF srgba(149,47,42,1)
           152: (153,50,45,255) #99322DFF srgba(153,50,45,1)
             3: (155,36,33,255) #9B2421FF srgba(155,36,33,1)
             2: (158,54,49,255) #9E3631FF srgba(158,54,49,1)
          4326: (162,42,37,255) #A22A25FF srgba(162,42,37,1)
          2932: (162,68,62,255) #A2443EFF srgba(162,68,62,1)
          4574: (163,58,53,255) #A33A35FF srgba(163,58,53,1)
             7: (168,61,56,255) #A83D38FF srgba(168,61,56,1)
          2773: (168,81,74,255) #A8514AFF srgba(168,81,74,1)
            21: (171,51,45,255) #AB332DFF srgba(171,51,45,1)
           273: (173,67,62,255) #AD433EFF srgba(173,67,62,1)
           388: (175,128,123,255) #AF807BFF srgba(175,128,123,1)
          3842: (180,73,67,255) #B44943FF srgba(180,73,67,1)
          2893: (180,90,83,255) #B45A53FF srgba(180,90,83,1)
          4007: (183,61,56,255) #B73D38FF srgba(183,61,56,1)
           177: (183,93,85,255) #B75D55FF srgba(183,93,85,1)
          3781: (187,81,74,255) #BB514AFF srgba(187,81,74,1)
           117: (188,63,61,255) #BC3F3DFF srgba(188,63,61,1)
            35: (191,73,69,255) #BF4945FF srgba(191,73,69,1)
          5056: (194,70,67,255) #C24643FF srgba(194,70,67,1)
             1: (194,87,80,255) #C25750FF srgba(194,87,80,1)
          3854: (196,96,87,255) #C46057FF srgba(196,96,87,1)
          5231: (200,77,74,255) #C84D4AFF srgba(200,77,74,1)
          5497: (201,102,92,255) #C9665CFF srgba(201,102,92,1)
             2: (201,170,166,255) #C9AAA6FF srgba(201,170,166,1)
           102: (204,79,76,255) #CC4F4CFF srgba(204,79,76,1)
           478: (204,105,96,255) #CC6960FF srgba(204,105,96,1)
           227: (205,174,170,255) #CDAEAAFF srgba(205,174,170,1)
          5449: (208,88,84,255) #D05854FF srgba(208,88,84,1)
           219: (210,95,90,255) #D25F5AFF srgba(210,95,90,1)
         10427: (212,110,99,255) #D46E63FF srgba(212,110,99,1)
          7472: (214,98,93,255) #D6625DFF srgba(214,98,93,1)
           132: (216,114,103,255) #D87267FF srgba(216,114,103,1)
          7819: (217,102,96,255) #D96660FF srgba(217,102,96,1)
           317: (218,117,107,255) #DA756BFF srgba(218,117,107,1)
           415: (219,105,99,255) #DB6963FF srgba(219,105,99,1)
         10400: (221,108,102,255) #DD6C66FF srgba(221,108,102,1)
         10340: (222,111,103,255) #DE6F67FF srgba(222,111,103,1)
           508: (224,115,107,255) #E0736BFF srgba(224,115,107,1)
          1914: (226,94,90,255) #E25E5AFF srgba(226,94,90,1)
         10190: (226,118,110,255) #E2766EFF srgba(226,118,110,1)
          9119: (229,121,113,255) #E57971FF srgba(229,121,113,1)
          8511: (231,125,117,255) #E77D75FF srgba(231,125,117,1)
            36: (235,129,122,255) #EB817AFF srgba(235,129,122,1)
          7368: (237,133,126,255) #ED857EFF srgba(237,133,126,1)
            15: (239,136,129,255) #EF8881FF srgba(239,136,129,1)
          6945: (241,140,133,255) #F18C85FF srgba(241,140,133,1)
            16: (242,142,135,255) #F28E87FF srgba(242,142,135,1)
             7: (243,119,113,255) #F37771FF srgba(243,119,113,1)
           785: (244,146,138,255) #F4928AFF srgba(244,146,138,1)
          1476: (246,124,117,255) #F67C75FF srgba(246,124,117,1)
          5662: (246,147,139,255) #F6938BFF srgba(246,147,139,1)
           634: (252,226,214,255) #FCE2D6FF srgba(252,226,214,1)
            41: (253,144,138,255) #FD908AFF srgba(253,144,138,1)
          3106: (254,154,146,255) #FE9A92FF srgba(254,154,146,1)
          1060: (254,201,193,255) #FEC9C1FF srgba(254,201,193,1)
          2367: (255,166,157,255) #FFA69DFF srgba(255,166,157,1)
          1743: (255,180,170,255) #FFB4AAFF srgba(255,180,170,1)
            27: (255,196,187,255) #FFC4BBFF srgba(255,196,187,1)
             2: (255,233,213,255) #FFE9D5FF srgba(255,233,213,1)
           557: (255,248,245,255) #FFF8F5FF srgba(255,248,245,1)
           216: (255,255,254,255) #FFFFFEFF srgba(255,255,254,1)
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 760x548+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2022-06-24T17:32:54+00:00
    date:modify: 2022-06-24T17:24:16+00:00
    png:acTL: chunk was found
    png:IHDR.bit-depth-orig: 8
    png:IHDR.bit_depth: 8
    png:IHDR.color-type-orig: 3
    png:IHDR.color_type: 3 (Indexed)
    png:IHDR.interlace_method: 0 (Not interlaced)
    png:IHDR.width,height: 760, 548
    png:PLTE.number_colors: 254
    png:sRGB: intent=0 (Perceptual Intent)
    png:tRNS: chunk was found
    signature: ee4f86ebe281a43800609ef38d3af4f896e82f42352aa7d885bbb22f4e6404fb
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 2.5673MiB
  Number pixels: 416480
  Pixel cache type: Memory
  Pixels per second: 27.432MP
  User time: 0.016u
  Elapsed time: 0:01.015
  Version: ImageMagick 7.1.0-36 Q8 x64 be0bdc3:20220530
cédric (dev) said, on 01/07/2022
how much difference?
megalol said, on 01/07/2022
animated png in v1 (no difference after compression, literally zero bytes), in v0.99 same file up to 2 times smaller (quality is bad but this doesn't matter in current question).
cédric (dev) said, on 04/07/2022
>> quality is bad but this doesn't matter in current question
actually it does. there is a heuristic that performs a risk score in -auto to select the lossy transform, but i need the file to confirm
megalol said, on 04/07/2022
Ok, here is 1st file https://workupload.com/file/feunt2PECZ3 (compressed with v0.99) and 2nd file https://workupload.com/file/JRT5GdUggY6 (original, stays the same in v1.0 after compression). Since file already small it's hard to see much quality loss, on bigger files (with heavy NSFW) easier to see big color loss but as I said earlier it's OK for me coz I intentionally set quality to 20 to make animated png's size almost twice smaller...
cédric (dev) said, on 04/07/2022
i consider this as bug in 0.99. you could override the heuristic with -pngpalette=N
megalol said, on 04/07/2022
Ok, thanks in v1.0 "pingo.exe -pngpalette=15 -noconversion 2.png" this command gave same size as "pingo.exe -auto=20 -noconversion 2.png" in v0.99 but now I don't see much color loss like it's with v0.99 that makes colors more pale so problem has been solved for me.

reply