I would like to encode/decode an image in an encoding like base64. However, I’m not using base64 because the encoded result is too large: I want the encoded size to be small.
I’ve searched Google many times, but have not found any useful information for my requirement.
Can anyone help me to find a more compact encoding than base64?
If your requirement is that the encoded image must be printable in ASCII, then Base64 is probably a good generic bet. If your requirement is really to have as small a binary representation of your image as possible, look into JPEG and PNG (depending on the type of image, requirement of lossy/lossless etc). If you have a lot of time on your hands and want to fiddle with mathematics, try fractal compression?
As others have commented, if your requirement is to store an image in a database, most/all RDBMS provide some form of BLOB to achieve just that.
Cheers,