Before forking and figuring out the Canvas lib used here, I wanted to see if this is maybe on the roadmap at some point.
I am testing single-page PDFs and it works great, however, I have a large library of snapshots I need to test through. Each page (95% white, a bit of text here and there, sometimes a small logo on top) is close to 100 KBs for each PNG. This escalates quickly, especially because the snapshots live in the repo.
I tried lowering the DPI to 36 but that was pointless, so staying at 72 for now.
I then took one of the generated snapshot PNGs and ran it through any of the "compress PNG" tools online, which immediately reduced size by 70%. The compress image looks pretty much the same (to the human eye), at 70% space-savings.
I then realized, that for many (of my cases, but I am sure this affects others too), it would be totally okay to have a super-compressed, small-palette PNG for the snapshots. I am mostly looking for significant layout shifts or omissions of entire passages of text, so it doesn't have to be pixel perfect.
If you can point me to where I could start looking at getting this done in the code, I'd maybe try a PR.
Before forking and figuring out the Canvas lib used here, I wanted to see if this is maybe on the roadmap at some point.
I am testing single-page PDFs and it works great, however, I have a large library of snapshots I need to test through. Each page (95% white, a bit of text here and there, sometimes a small logo on top) is close to 100 KBs for each PNG. This escalates quickly, especially because the snapshots live in the repo.
I tried lowering the DPI to 36 but that was pointless, so staying at 72 for now.
I then took one of the generated snapshot PNGs and ran it through any of the "compress PNG" tools online, which immediately reduced size by 70%. The compress image looks pretty much the same (to the human eye), at 70% space-savings.
I then realized, that for many (of my cases, but I am sure this affects others too), it would be totally okay to have a super-compressed, small-palette PNG for the snapshots. I am mostly looking for significant layout shifts or omissions of entire passages of text, so it doesn't have to be pixel perfect.
If you can point me to where I could start looking at getting this done in the code, I'd maybe try a PR.