Compared to the other tool this is just "slow code, but now with threads." This problem is perfect to exploit capabilities of modern CPUs, and neither of the projects does so. At least this one iterates over the y coordinates in the outer loop. Nothing about what either tool does is noteworthy.
Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
41–50 of 66 posts
Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#42Earlier quoted context omitted.
Considering the source material is a file, that needs to be loaded up by the CPU first, and the operation itself is dead simple, the real constraint is RAM bandwidth. I would guess that the time of getting the data out to the GPU and back, is about the same as just calculating the difference on the CPU. So, the quickest solution is probably to use the CPUs vector operations, and read ahead into the registers so you c…
GPU can now directly read the file on the SSD.
Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#43Looks like a for loop iterating over each pixel one row at a time. What makes this fast?
It does at least parallelize the work across available cores.
https://github.com/n7olkachev/imgdiff/blob/master/pkg/imgdif...
Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#44When making an image manipulation/creation/diff/etc tool I'd highly recommend showing at least a screenshot or two of the result in the Github itself.
Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#45I'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
#46Why 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.
The bottleneck is almost certainly decoding the image (PNGs are zlib compressed, which will be going at something like ~300 MB/s plus the filter stuff PNG does), not comparing raw pixels (which you should be able to do at memory bandwidth, so something in excess of 10 GP/s).
Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#47It was achieved by looping over every RGB pixel from the PNG rendered image of each URL.
https://github.com/sammcj/urldiff
Not exactly something I'm proud of, but the pixel loop solution did make me laugh at the time.
Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#48Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#49I solved this problem for my use case by using an approximate diff. Basically diffing took too long ( I was diffing to remove duplicate frames from a virtualized browser to browser screencast ), so after trying to various options (hashing, diffs, etc) I just went with a simple check of a basically random but fixed set of pixels, which worked really well. I don't have data on the actual false positives/ negatives but…
Re: Imgdiff: Faster than the fastest pixel-by-pixel image difference tool
#50Earlier quoted context omitted.
GPU can now directly read the file on the SSD.
Citation needed? I know things have been announced but what's available now?