Base64 encode

Is there a way to base64 encode a png file and create a txt file with the code?
So if I create foo.png then Hazel should create foo.txt for me with the base64 code in it.
Thanks for your help. Kind Regards
Georg
So if I create foo.png then Hazel should create foo.txt for me with the base64 code in it.
Thanks for your help. Kind Regards
Georg