emersion / grim

Grab images from a Wayland compositor

Home Page:https://wayland.emersion.fr/grim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inaccurate downscaling with scale factors less than 0.5

mstoeckl opened this issue · comments

Running grim -s 0.25 does not accurately downscale text. Left is using grim before #101, right is using grim after #101. The issue is that the PIXMAN_FILTER_BEST level is not actually as good as CAIRO_FILTER_BEST; the former only ever combines values from up to 4 pixels via bilinear interpolation, while the latter combines all the pixels in the original image that are drawn onto a single destination pixel; see cairo-image-source.c#L981-999

good-text bad-text

I should be able to fix this within a few days; AFAIK all that is needed to do is to use PIXMAN_FILTER_SEPARABLE_CONVOLUTION with a filter created by pixman_filter_create_separable_convolution, using appropriate parameters.