You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has already been discussed here: #69 . I guess the resolution/fontsize combination determines this. I'm looking at sizes around the
Set FontSize 12
Set Width 1280
Set Height 720
ballpark but the text looks really blurry. A video created by agg at a similar resolution comes out much crisper. I've been trying different combinations of these values with vhs but haven't had any luck.
From the afformentioned issue:
One thing you can try is to increase the Height and Width and increase the FontSize and then scale it down after.
I'd rather not have to do this every time. It's much easier to reproduce the image (where other contributors might want to modify it etc..) if all I need is a .tape file (really cool stuff!).
I think there might be a few things we can do somethings on our end regarding font anti-aliasing, etc... as well
When removing this line (and relinking the ffmpeg stages together correctly), the image quality significantly improves. Note, you also need to disable the arguments (just comment them out).
To solve this problem we need to make sure we never scale up or down the original images and extend the images to include padding. By trying to keep the terminal width and height the same even after padding, we are down scaling. This has a major impact on text quality.
@maaslalani Can you provide some guidance on how we should apply padding? If we want the quality to be the best possible, we need to add the padding to the edges. This means the width and height specified in the recording is not the true final output. This would be a breaking change and needs to be very carefully considered.
Dithering
I also believe part of the problems with quality are attributed to the limitations with GIF palette. I am still experimenting with the following change to this code:
Disabling font subpixel positioning and setting font render hinting to none may help improve quality. We will need better ways to evaluate the visual differences (my eyesight isn't good enough to notice the differences).
Summary
The main improvements we can make to output quality will come from fixing the scaling filter. I have concerns that even feeding in the same values is causing quality degradation even if there is no padding. We need guidance on how best to add padding before we can fix this problem.
Other areas of improvement can come from managing the limited palette of the GIF images and disabling Chromium font settings.
Reacted by k4lizen, Maas Lalani, Texarkanine, pierow2k, marshall and Jason Pickens
I started a discussion #644 around a working (for me) SVG implementation fork at https://github.com/agentstation/vhs - might be relevant to getting a clear output! 😄
agg is nice, and you can get tape-like recordings with it via S-VHS - a bash wrapper around tmux + asciinema + agg. No blurriness, and the recording stays a single reproducible script, like a .tape.
Activity
mikelorant commentedon Jun 2, 2025
This issue has been bothering me for a while and I've been trying to solve it for a long time. Finally, I found the main cause of this problem.
Scaling
This is all caused by the scaling filter used for handling the padding.
vhs/ffmpeg.go
Line 27 in 9901ed9
When removing this line (and relinking the
ffmpegstages together correctly), the image quality significantly improves. Note, you also need to disable the arguments (just comment them out).vhs/ffmpeg.go
Lines 32 to 33 in 9901ed9
To solve this problem we need to make sure we never scale up or down the original images and extend the images to include padding. By trying to keep the terminal width and height the same even after padding, we are down scaling. This has a major impact on text quality.
@maaslalani Can you provide some guidance on how we should apply padding? If we want the quality to be the best possible, we need to add the padding to the edges. This means the width and height specified in the recording is not the true final output. This would be a breaking change and needs to be very carefully considered.
Dithering
I also believe part of the problems with quality are attributed to the limitations with GIF palette. I am still experimenting with the following change to this code:
vhs/ffmpeg.go
Line 182 in 9901ed9
We may be able to improve the results using:
By default, colours are dithered using
sierra2_4a, we can disable this withnone.Font
It is also worth experimenting with the Chromium headless settings. We may get some benefit with changing:
vhs/vhs.go
Line 141 in 9901ed9
We can add two arguments:
Disabling font subpixel positioning and setting font render hinting to none may help improve quality. We will need better ways to evaluate the visual differences (my eyesight isn't good enough to notice the differences).
Summary
The main improvements we can make to output quality will come from fixing the scaling filter. I have concerns that even feeding in the same values is causing quality degradation even if there is no padding. We need guidance on how best to add padding before we can fix this problem.
Other areas of improvement can come from managing the limited palette of the GIF images and disabling Chromium font settings.
k4lizen commentedon Jun 2, 2025
(btw the same issue is present no non-GIF file formats)
jackspirou commentedon Aug 6, 2025
I started a discussion #644 around a working (for me) SVG implementation fork at https://github.com/agentstation/vhs - might be relevant to getting a clear output! 😄
dimk90 commentedon Aug 25, 2026
aggis nice, and you can get tape-like recordings with it via S-VHS - a bash wrapper aroundtmux+asciinema+agg. No blurriness, and the recording stays a single reproducible script, like a .tape.