What is the effect of encoding an image in base64?

后端 未结 6 981
鱼传尺愫
鱼传尺愫 2020-11-22 07:21

If I convert an image (jpg or png) to base64, then will it be bigger, or will it have the same size? How much greater will it be?

Is it recommended to use base64 enc

6条回答
  •  半阙折子戏
    2020-11-22 07:54

    Here's a really helpful overview of when to base64 encode and when not to by David Calhoun.

    Basic answer = gzipped base64 encoded files will be roughly comparable in file size to standard binary (jpg/png). Gzip'd binary files will have a smaller file size.

    Takeaway = There's some advantage to encoding and gzipping your UI icons, etc, but unwise to do this for larger images.

提交回复
热议问题