Why are all my lines fuzzy in cairo?
Make sure your lines are sharp using this simple trick.

I'll take you step by step into how to make a service that takes screenshots of webpages and returns them as an image.
First, let's assume you have google-chrome or chromium-browser installed. Both should work the same way. These browsers have command line options that let you capture a screenshot in headless mode.
chromium-browser --headless
--disable-gpu
--no-sandbox
--screenshot=out.png
--window-size=1280,900
--virtual-time-budget=1000
--user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"
https://cbc.ca/news
| --headless | Put it in headless mode |
| --disable-gpu | Using GPU in the background sometimes gives us problems, so we disable it |
| --no-sandbox | The sandbox often gives problems with headless execution as well. |
| --screenshot="<filename>" | You can tell it to capture the screenshot to this file. |
| --window-size=width,height | Set the width and height of the window |
| --virtual-time-budget=<ms> | Wait this many milliseconds before taking the screenshot, to give the site time to execute frontend frameworks. |
| --useragent="<user agent>" | Set a custom user agent, since many sites will not work with the default one used in headless mode. |
| url | Url of the site to screenshot
Let's make it into a docker image that we can use. I won't go into the details, since I merely asked AI to do it for me. Synchronize the repo it made here:
git clone github.com/smhanov/screenshot-service cd screenshot-service make build make run
This will build and create your screenshotting service.Then you can get the screenshot of any web site by going to the url:
http://localhost:5000/screenshot?url=https://cbc.ca/news
It also accepts other parameters for the various arguments.
Make sure your lines are sharp using this simple trick.
If you have to draw something called "UML Sequence Diagrams" for work or school, you already know that it can take hours to get a diagram to look right. Here's a web site that will save you some time.
If one apple costs $1, how much would five apples cost? How about 500? If everyday life, when you buy more of something, you get more bananas for your buck. But software companies are bucking the trend.
If you have a web site with a search function, you will rapidly realize that most mortals are terrible typists. Many searches contain mispelled words, and users will expect these searches to magically work. This magic is often done using levenshtein distance. In this article, I'll compare two ways of finding the closest matching word in a large dictionary. I'll describe how I use it on rhymebrain.com