From Newsgroup: alt.os.linux.mint
On Wed, 9/30/2026 6:53 PM, Alan K. wrote:
On 9/30/26 3:37 PM, Paul wrote:
On Wed, 9/30/2026 11:12 AM, Alan K. wrote:
I've developed a few icon themes for Linux.-a There are 11,557 images / links in the theme.
I've run meld on the two folders and no files are missing.-a But there are 100's that do not match.-a Yet when I visually compare the images they are the same.
I even ran optipng on all png images in an attempt to recompress the PNGs and maybe get them all the same but that didn't work.-a The overall results actually enlarge the folder contents.
I'm looking for some utility that can compare two images and see if they are the same visually.-a-a Tall order huh?!!!
Fairly tall order, I would say.
I did not resort to using AI, so it took time to track this down.
I had to rewrite the post, once I found a candidate.
You're not going to get away entirely unscathed by visiting this web page :-)
-a-a https://imagemagick.org/compare/#gsc.tab=0
The capabilities of a file format, help define what a
pain in the ass it is going to be.
-a-a https://en.wikipedia.org/wiki/PNG
-a-a-a PNG supports palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors),
-a-a-a grayscale images (with or without an alpha channel for transparency), >> -a-a-a and full-color non-palette-based RGB or RGBA images.
-a-a-a gAMA specifies gamma
-a-a-a iCCP is an ICC color profile
If an image has an alpha channel, we can spot it. You can get some demo images here.
-a https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png
-a-a-a # This one shows what the alpha looks like. Could be one byte per pixel, set aside for it.
-a-a-a https://commons.wikimedia.org/wiki/File:PNG_transparency_demonstration_3.png
The file command points that out. The one with an alpha mask, is different. >>
-a PNG_transparency_demonstration_1.png:-a-a-a PNG image data, 800 x 600, 8-bit/color RGBA, non-interlaced
-a big-screenshot.png:-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a PNG image data, 6144 x 6144, 8-bit/color RGB, non-interlaced
-a-a-a Paul
Tall order I know.-a I'll read those links for a good bed time story, but I've given up on the task.
The problem was using meld to see what items have or have not been change in one icon theme vs another.-a-a Meld uses something to compute a diff, also date and size effect the decision too.
It's just cosmetic and I'm lazy.-a I want 'this is different, period'.-a I'll keep playing and reading.-a Maybe I'll get there.
Thanks.
You can tell the degree of doom involved, in that there are applications
such as your optipng as well as pngcrush. Which attempt to try different control settings, to achieve the smallest file size. If it were easy to quantify PNG, we would not need to do this. We would know immediately
what size each would be, and so on.
The Imagemagick "compare" is the closest I could come to a local
execution based solution. I don't know how good it is.
My idea of converting the files to some sort of "neutral metric",
that wasn't looking so good. BMP supports an alpha channel, which
would allow comparison after conversion. Whereas PNM as a neutral
format, doesn't have an alpha channel. PNM is about as "raw" as it
gets, as it just contains RGB tuples. Unfortunately, BMP has a
few other options in it, making it less ideal.
I think you should install Imagemagick and give the "compare"
executable a try, with your stock of PNG files. Just to see
if the application is not workable, or is potentially a solution
some day.
There are other heuristic image comparison tools, but they check
for "approximate similarity". With those, you can compare a
2560x1600 to a smaller image, and see if the computed value
for the two images match (the heuristic attempt to be scale
invariant). This can be used for dedup purposes, but it's
pretty dangerous in that it is a heuristic, not a closed
form calculation. It gives good results... some times.
Paul
--- Synchronet 3.22a-Linux NewsLink 1.2