Closed moshensky closed 2 months ago
As per your comment about the origin point - if the current behaviour is to define the mask in pixels (which just happens to have a 1:1 relationship to points based on the upscaling or not) and the mask is indeed applied after converting to a PNG, perhaps a low-touch approach is to:
Not entirely sure but these lines may give you trouble? I haven't used canvas however so am guessing: https://github.com/moshensky/pdf-visual-diff/blob/feat/expose-png-scaling-option/src/pdf2png.ts#L83
Cheers moit!
This PR introduces an option to set image scaling, which provides the benefit of significantly faster comparisons, albeit at the cost of image quality when using lower than the default DPI value, e.g. 72 instead of 144.
Solves #58