@mcc There's quite a few PNG optimisers that will do this for you. If there's 256 colours or fewer, it almost always makes sense to convert the image to paletted mode (which can still retain alpha translucency – my avatar image makes use of this).
If you have a fediverse account, you can quote this note from your own instance. Search https://infosec.exchange/users/jernej__s/statuses/115748174984206833 on your instance and quote it. (Note that quoting is not supported in Mastodon.)