1[:octicons-file-code-24:][_b64]{: .source-link } 2 3# B64 4 5## Overview 6 7B64 allows for the embedding of local PNG, JPEG, and GIF image references with base64 encoding. It simply needs a base 8path to resolve relative links in the Markdown source. The base path is the assumed location of the Markdown source at 9time of conversion. Using the base path, B64 will search and find the actual `img` tag references (both absolute and 10relative) and base64 encode and embed them in the HTML output. 11 12If you would like to distribute a Markdown output without having to also distribute the images separately, B64 can help. 13In a normal website, this would probably not be desired. 14 15!!! example "B64 Example" 16 17 === "HTML" 18 ```html 19 <p><img alt="picture" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAMAAAAOusbgAAAAqFBMVEU5eZdll66Yucjd7h7d7h7d7h5ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll65ll66YuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYuciYucgXVONTAAABDklEQVRoge3XR3ICQRBE0b/Ce2+FAAnkLeb+N9MRNBvFR0H2vuJFT3dX5VAqV6q1eqPZane6vf5gOBpPprP5YnnD72t1u95s7+53+4fHp+eX17f3j8+v78PxdC5Qi+SWkNwykltBcqtIbg3JrSO5DSS3ieS2kNw2kttBcrtIbg/J7SO5AyR3iOSOkNwxkjtBcqdI7gzJnSO5CyR3WaD0T1xrv3Hjxo0bN27cuHHjxo0bN27c63Sx9ov1nbHOF+teYd1nrHeE9X6x+gZWv8Lqk1j9GWsuYM0jrDmINX+x5j5W3sDKOVj5CivXYeVJrByLlZ+xcnuB0n/5vxA3bty4cePGjRs3bty4cePGvUj3B2JzyvcNRmTGAAAAAElFTkSuQmCC" /> 20 ``` 21 22 === "Markdown" 23 ``` 24 ![picture](../_assets/bg.png) 25 ``` 26 27The B64 extension can be included in Python Markdown by using the following: 28 29```py3 30import markdown 31md = markdown.Markdown(extensions=['pymdownx.b64']) 32``` 33 34## Options 35 36Option | Type | Default | Description 37----------- | ------ | ----------- |------------ 38`base_path` | string | `#!py3 '.'` | A string indicating a base path to be used to resolve relative links. 39