ImageMagik's convert function will sometimes do things like this when there isn't a great deal of room for compression. If you work with a lot of PNGs, then you may be interested in optipng which offer a bit more flexibility when optimising PNG files.
Using the following command, a full-screen capture of this AskUbuntu question has the following result:
-rw-r--r-- 1 jason jason 1371805 9月 8 10:35 Screenshot_20220908_103518.png
optipng -o7 Screenshot_20220908_103518.png
-rw-r--r-- 1 jason jason 480525 9月 8 10:37 Screenshot_20220908_103518.png
You can adjust the optimisation level with the -o option, with values between 5 and 7 generally returning the better results. Values of 8 and 9 may result in some pixellation of photos with a wide colour range.