Minor enhancement suggestion: Allow users to write text on masks
I think it would be fairly easy to update the code at
https://github.com/moshensky/pdf-visual-diff/blob/master/src/compare-pdf-to-snapshot.ts#L37C8-L39C10
to something like this
if (type === 'rectangle-mask') {
let mask = new Jimp(width, height, colorToNum[color])
mask.print(...) // process mask with https://github.com/jimp-dev/jimp/tree/main/packages/plugin-print
img.composite(mask, x, y)
}
With this update, a user can easily communicate what each mask region is for. the screenshots could be easier to understand in the follow use cases:
- if the creator and the maintainer are not the same person
- The code was written a long time ago
- code review
You are right, it indeed looks somewhat easy to be added. Would you like to contribute?
Unfortunately, not at the moment because I found this repo via work related reasons and we have a open source contribution approval process with legal that I'm not really excited to go through (yes, even for MIT).
I'm happy to contribute if my employer decides to adopt this tool so I have a business case to make. Or a few years later when the policy changes
I don’t have immediate plans to implement this functionality at the moment, so I’ll be closing the issue for now. If anyone would like to see this feature added in the future, feel free to comment or reopen the issue.