Knowledge Drop

How do I render a local image in Looker?

  • 5 April 2021
  • 6 replies

Userlevel 5
  • Looker Staff
  • 173 replies

Last tested: March 2021


Looker expects a public URL for your image. So make sure that wherever you store it is publicly accessible. Then, you can call it in LookML like so:

view: view_name { dimension: field_name { html: <img src=”” /> ;; }}

This help center article goes more in depth on the modeling.

It's not possible to use a local image on your computer, or on the Looker server. It is also not possible to use non-public URLs, as Looker will have no way to authenticate.


This content is subject to limited support.                

6 replies

Hi guys, i wanted to know if it was still impossible to use a local image ?

I’m currently using images host on my server, but whenever i try to export dashboard containing those images, it export with no images.

Userlevel 5

@Irvin That’s correct. It’s not possible to use a local image - either on your own server or on the Looker server.  You’ve gotta use a URL.


If you can access Looker’s product feedback system, then you can upvote this feature request and leave more details with your use case!


Userlevel 1

Hi @Irvin, @sam 

If you need to add an image that should not be hosted on a public domain you can insert it as a base64 encoded string. This works in LookML as well as Text tiles. Please be aware that for larger images this renders the Text tile popup unresponsive. So, please make sure you have the content ready to paste and avoid editing within the online interface.

First encode the image into a base64 string (e.g. using python):

python -mbase64 image.png | tr -d '\n' > b64encoded.txt

Then insert a tile with a content like the following:

<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Grid US" />

Hi, @nicohein 

this solution works as intended with Text Tiles, but not with LookML.

I tried with the img you provided (which works well in a text tiles as i said), and this renders nothing but a white screen.


Do you have any solution to put base64 img in a dimensions in lookML ?

and thanks for the later response !


Userlevel 1

Hi @Irvin,

unfortunately I can be of very little help for this one. I just had a quick look and it seems like Looker has some validations for the source values.

While the following renders as it should:

<img src="dataimage" alt="Test" />;

Adding either a colon or a semi-colon makes src parameter disappears:

<img src=";" alt="Test" />; <!-- renders as --> <img alt="Test" />;
<img src=":" alt="Test" />; <!-- renders as --> <img alt="Test" />;

If I add a space the output indicates that Looker also applies url encoding which is not useful in your case:

<img src="data image" alt="Test"> <!-- renders as --> <img src="data%20image" alt="Test">

I would hope your images are not secret and you can do something like using GitHub e.g. 

dimension: logo {
label: "Logo"
type: string
sql: "" ;;
html: <img src="" alt="Test" />;;

or using a public bucket to host your static content.

We had to remove the space, as so

  dimension: images {
type: string
sql: BASE64(${TABLE}.content) ;;
html: <img src="data:image/jpeg;base64,{{value}}"/>;;