codevis icon indicating copy to clipboard operation
codevis copied to clipboard

Variable resolution

Open FlareFlo opened this issue 2 years ago • 3 comments

It would be nice to create a higher resolution image so that code remains readable.

FlareFlo avatar Sep 03 '22 19:09 FlareFlo

@FlareFlo I agree, that would be nice. Currently all characters are rendered as 2 pixels high and 1 pixel wide. This was inspired by the scroll bar to the right of vscode.

I am willing to look into rendering the characters as readable text, but am not currently aware of libraries that do it. Please let me know of if you find any.

DO NOTE This would make images much larger. Rendering the Linux kernel, for instance, already generates a PNG file that is around 2GB.

sloganking avatar Sep 03 '22 19:09 sloganking

DO NOTE This would make images much larger. Rendering the Linux kernel, for instance, already generates a PNG file that is around 2GB.

Maybe chunking should be used to avoid very large file transactions and to possibly multithread the work in some areas.

FlareFlo avatar Sep 12 '22 12:09 FlareFlo

Maybe chunking should be used to avoid very large file transactions

Like dividing the output image into multiple smaller output images? It could be done, but you'd need a special image viewer to stitch the images back together.

and to possibly multi-thread the work in some areas.

Luckily we've already made codevis multi-threaded now.

sloganking avatar Oct 03 '22 17:10 sloganking

Apparently text rendering from font files seems like an impossibly complex nightmare. But having codevis make text readable could be done with bitmap fonts like unifont-bitmap. unifont-bitmap doesn't offer various font sizes, but it does support the Unicode characters required to speak most languages. Making it a better choice than other options that could not display text or code in other languages.

sloganking avatar Feb 23 '23 22:02 sloganking

@FlareFlo Images can now be made readable with the --readable flag in release v0.6.0

sloganking avatar Feb 25 '23 18:02 sloganking