普通のimgタグでPNG画像を掲載する場合
<img src="/img/article/294/2020-04-18-181228.png">
これはサーバにアップされた画像を通信して表示しています。
以下はBase64エンコードされた画像データを表示する場合
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAMAAAD0WI85AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3VpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDM1MiwgMjAyMC8wMS8zMC0xNTo1MDozOCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpiODViMDYzZC0yY2ZiLTRlMDUtYTA3YS04NTEzNDlkMDY5OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NkVDQTI3N0E3OTc4MTFFQUEyRkFCRDY5Q0FERDFGNzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NkVDQTI3Nzk3OTc4MTFFQUEyRkFCRDY5Q0FERDFGNzYiIHhtcDpDcmVhdG9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44MgAAgl63eDJB8kEVPHwRIPsjKFScBEg8yNPHXAEDiQRY9+x0kpXQHef79YxsBkg5y4JrrhyFRpQPI2M83fwCJK+0g48d3jVw8B5JYCMj4+HMbjnyx6+Mt2w9BcotI/yhMjPKfAAMAkvkTAZvWU5kAAAAASUVORK5CYII=">
Base64エンコードは画像をテキストデータにして表示する方法なので、画像への通信が発生しません。
なので表示速度は理論上早くなります。
Macのターミナルで「base64 画像ファイルのパス」を実行するとテキストへの変換が可能です。
他の方法でも変換できますが、生成されるテキストは同じです。
JPEG、GIF、SVGなどにも使えますが、HTMLがとんでもないことになるので、小さい画像でどうしてものときだけ利用するのが良さそうです。