how can i encode image to baese64 in SD card to a string or text file?

i have a jpeg image that is in a SD card i want to encode this picture to base64 and store base64 image in text file in SD card.what should i do...
i know i must read file but its byte and how can i it to base64?
thank you for helping me...

Did you see this:

The example uses serial, so it would need adapting for SD file processing, but it looks to be what you need.

MarkT:
Did you see this:
GitHub - adamvr/arduino-base64: A base64 library for the arduino platform, written in C

The example uses serial, so it would need adapting for SD file processing, but it looks to be what you need.

thanks it was good library it work it for me