Languages:
- English
- français
- Nederlands
- русский
Base64
If you want to use inline encoding of icons for Imageries, Presets, Styles or Rules here are some hints:
- You can use web tools to convert your image to the base64 code, e.g.:
- Before you convert your image to the base64 code you should minimize it to make the base64 a lot shorter (without loosing quality):
- for
.png
files: Use e.g. compresspng.com, - for
.jpeg
files: Use e.g. jpegcompress.com, - for
.svg
files: Use e.g. svg cleaner. When using this one you can use the "complete" preset to clean up the svg file. More information about possible problems with svg in JOSM see DevelopersGuide/DefaultPresets#NewIcons.
- for
- Code structure:
data:image/png;base64,...databytes...
data:image/svg+xml;base64,...databytes...
- Real example (paste that code into the address bar of your web browser to see the image):
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAADFBMVEUTPmdaXSdnXUmdcyo9AbYLAAAAFklEQVQI12NYtYqBgYEI4v//0FAiCAA8TB/hMzHkwAAAAABJRU5ErkJggg==
Back to Styles#Iconhandling
Last modified
7 weeks ago
Last modified on 2025-01-13T23:21:12+01:00
Note:
See TracWiki
for help on using the wiki.