vinsguru / pdf-util

PDF Compare Utility
98 stars 69 forks source link

The Shift Checker #22

Open Gnyblast opened 4 years ago

Gnyblast commented 4 years ago

I was troubling with a problem of shifts on two same PDF. In visual mode, two same PDFs sometimes is not same on pixel level. There could be few pixel shift or less than a pixel. In that scenarios I would have them all marked and flagged as different. I created another method into ImageUtil.java that checks if it is a shift or not. This could be activated by PDFUtil.java by passing 1 more parameter in it which is a overloading method. Please not that this method do not takes colors into consideration because I had to make all PDFs B&W in order to prevent shadings and fading of the colors when there is a shift less than a pixel level. Out put result is still colored version but checks are B&W.