Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Have you tried running the original through a high pass filter (to get the textures) and applying it over the vectorized version? It might work for the background texture, though it would probably suck for the text.


It would preserve all the JPEG artifacts, which are the main reason the naively upscaled version looks so crappy in the first place.


There are well-known techniques to clean JPEG artifacts, but they need the tables from inside the JPEG to work best.

Since JPEG uses an 8x8 block transform, you can find artifacts by shifting the image a few pixels over and looking for how the transformed block changes, basically.

https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/vf_...

Also, using a better chroma upscale can help for small images. libjpeg just uses nearest-neighbor (no "real" resizing) and hardly anyone notices, but it helps with lines and edges.


I have not - although that's an interesting idea, thank you! Relative to my other projects this is a very low-priority exploration. I was very interested to see if there could be a "cheap win" for this particular sub-problem that I will be dealing with, should I get around to digitizing these books.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: