Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vnstati images in HiDPI res #226

Open
agneevX opened this issue Mar 3, 2022 · 3 comments
Open

vnstati images in HiDPI res #226

agneevX opened this issue Mar 3, 2022 · 3 comments
Labels

Comments

@agneevX
Copy link

agneevX commented Mar 3, 2022

With high res monitors being the norm these days, vnstati images look blurry.

Can it be updated to generate high res images?

@vergoh
Copy link
Owner

vergoh commented Mar 3, 2022

The vnstati generated images shouldn't look blurry regardless of the resolution of the display as long as the used resolution is the native resolution of the display panel. If the end result still looks blurry then it's worth checking that nothing is applying scaling to the images as then you usually loose 1:1 pixel mapping and the result looks blurry. Images being small I can understand but blurry sound more like an issue with the used setup.

For the "images are too small" situation there are already two options available that can also be combined if needed:

  1. Use the --large parameter. That will increase the size of used fonts and image elements resulting in bigger images.
  2. Use --scale 200 or --scale 300 depending on the wanted target size. The images will stay sharp as long as the parameter is a multiple of 100. Anything in between will also be supported but the end result may look a little bit blurry.

In addition, try the LineSpacingAdjustment configuration option with values greater than the default zero. While this doesn't increase the size of fonts or image elements directly, it may help with readability of the list type outputs.

@vergoh vergoh added the question label Mar 3, 2022
@agneevX
Copy link
Author

agneevX commented Mar 4, 2022

Thanks for getting back.

Yes, on second thought, blurriness is not what I'd describe the appearance on high res screens.

While I do use a scaled resolution, the issue is still that they look more "at home" on standard non-HD displays. This includes the font in the images that look pixelated on hi res screens.

On a 1366x768 monitor, where I use a 90% zoom, images and text look blurry, but at 100% zoom it looks great.

@vergoh
Copy link
Owner

vergoh commented Mar 8, 2022

The image output uses the built-in fonts from the graphics library (LibGD). All of those fonts are monospaced bitmap fonts and there's only few sizes available. That's why it's not possible to make the images any larger than what the --large option provides since scaling will only make the bitmap fonts look even more pixelated, or blurry if the scaling factor isn't an exact multiple.

The alternative would be to use TrueType fonts which LibGD supports too. However, with those the problem is that none is provided by default so at least some font would then need to somehow packaged with the distribution, which again adds more dependencies and possible licensing issues to think of. Having the possibility of providing any font would also result in much of the image output implementation needing to be rewritten to dynamically calculate the size of each image and element location depending on the spacing and size of the used fonts. That alone isn't a simple task and I've always hated non-bitmap fonts looking blurry when small point sizes are used so there hasn't really been motivation to push this forward. I suspect non-bitmap fonts wouldn't anyway solve the issue of images looking blurry when scaled to less than 100% of their original size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants