fabiensanglard / cpsb

The book of CPS-1
MIT License
110 stars 35 forks source link

Images with moire #63

Closed guilt closed 1 year ago

guilt commented 1 year ago

Filing that downscaling with a Lanczos filter may help with some of the images on pages 80 and 81.

fabiensanglard commented 1 year ago

If you are willing to experiment with it and send a PR, I could gladly consider it. Otherwise, it will stay this way.

guilt commented 1 year ago

I guess this happens when images are embededded within the SVG. I tried downscaling only the data/PNG portion of it and it seems to render better. But when put in a SVG, it produces the moire patterns. sf2_withoverscan_zero_png_downscaled

guilt commented 1 year ago

Further, I tried scaling just the PNG above and the SVG and I could see the side by side differences.

SxS-Moire

guilt commented 1 year ago

Any chance you'd be open to PNGs than SVGs on this one? :)

fabiensanglard commented 1 year ago

The image on the left does not show the scanline enough....and the one on the right shows them too much :/ !

guilt commented 1 year ago

They are the same image, the one on the right is the SVG version with the one on the left embedded, plus the axes. The scaling for the PNG in SVG does not follow the same rules as the scaling for just PNG. It is hoped that if you're open to embedding high-res PNGs in the PDF, you may want to pre-raster the SVG at a higher res to PNG and then embed that in the PDF, in the hope that even when shrunk, the images look better when rendered. That was the reason why I posted it.