Live data from Hacker News

Imgdiff: Faster than the fastest pixel-by-pixel image difference tool

github.com

1–10 of 66 posts

Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool

#3

Why not use the GPU? This is exactly the kind of tasks GPUs were designed for. Gimp can do this in real time using the difference layer mode.

Does using the GPU pay off for one-off diffing? It's "obvious" that it makes sense for Gimp, but does it for this?

Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool

#4
I'm finding "gm compare" to be faster.

    $ time ./imgdiff cypress.png cypress.png         
    Success! Images are equal.
    3.22user 0.10system 0:00.50elapsed 661%CPU 
    (0avgtext+0avgdata 478524maxresident)k
    0inputs+0outputs (0major+48339minor)pagefaults 0swaps
    
    $ time gm compare -highlight-style assign -highlight-color purple -file diff.png cypress.png cypress.png                                             
    1.99user 0.21system 0:02.21elapsed 99%CPU 
    (0avgtext+0avgdata 874948maxresident)k
    0inputs+5240outputs (0major+217173minor)pagefaults 0swaps

    $ time gm compare -metric mse cypress.png cypress.png                                                                                                
    Image Difference (MeanSquaredError):
               Normalized    Absolute
              ============  ==========
         Red: 0.0000000000        0.0
       Green: 0.0000000000        0.0
        Blue: 0.0000000000        0.0
     Opacity: 0.0000000000        0.0
       Total: 0.0000000000        0.0
    0.94user 0.14system 0:00.67elapsed 161%CPU 
    (0avgtext+0avgdata 585832maxresident)k
    0inputs+0outputs (0major+144881minor)pagefaults 0swaps

Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool

#5
I'm skeptical about it's high claims. Looking at the code its just using the Go standard library image package, looping over the bounds and calculating delta?

Doesn't seem like there's anything special here? It's roughly what any novice would build if asked to diff two images in Go?

Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool

#6
Years ago I worked with image processing and thought of writing a CLI image diff tool. I then thought meh, anyone can quickly roll their own.

Turns out it seems to be something people care about.

I should just start writing the CLI tools I think of, without dismissing their utility.

Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool

#7
post #5

I'm skeptical about it's high claims. Looking at the code its just using the Go standard library image package, looping over the bounds and calculating delta? Doesn't seem like there's anything special here? It's roughly what any novice would build if asked to diff two images in Go?

I just skimmed through the code, but as far as I can tell, the main point is that this code is multi-threaded.

Which, sure, gets the job done faster than the single-thread `odiff` on a single image, but is quite irrelevant for a tool marketed for tests/CI where many images are likely to be compared in parallel already (and maybe a single core is even available).

Post reply on HN