wallento / wavedrompy

WaveDrom compatible python command line
Other
97 stars 23 forks source link

Ticks Not Rendered Correctly #17

Closed MutantPlatypus closed 5 years ago

MutantPlatypus commented 5 years ago

I was trying to create a test step where the SVGs from wavedrom and wavedrompy are rasterized and compared and noticed a difference: the tick marks come out very slightly wrong. It's almost like the alpha for edges and the alpha for the fill of data regions are not the same between wavedrom and wavedrompy, or alphas are same and drawing order is different. When rasterized, the differences are only in the RGB channels, though The alpha channels match.

The differences in the below images have been enhanced (via PIL.ImageOps.autocontrast)

issue_14.json differences: issue_14_noAlphaDiff Original overlayed on difference: issue_14_differenceAndOriginalComposed

tutorial_1.json differences: tutorial_1_noAlphaDiff Original overlayed on differences: tutorial_1_differenceAndOriginalComposed

I'll generate the rest of these images and push them to the scratch branch of my fork tomorrow evening.

wallento commented 5 years ago

Hm, I think this can become tricky to fix, thanks for reporting and working on that!

wallento commented 5 years ago

Easier than I thought, I just made wrong assumptions before. Fixed in 0c49dfb, please confirm if it works, thanks!

MutantPlatypus commented 5 years ago

Yes, that fixed it. All of the upstream tests now pass a raster comparison test with cairosvg. Its a super aggressive test. Nice work! I'll toss over a pull request with that test soon.