Touch Bar Preview is a small open source application to display your designs on the Touch Bar of the new MacBook Pro. First, you need to drag and drop an image file (PNG, JPEG) into the app. The image should be 2170px wide and 60px high. Since the Touch Bar is a high-resolution Retina display, this is equivalent to 1085pt by 30pt.
The app automatically cuts out the System button (Esc) and Control Strip so you don't have to exclude them in your design. If your image is bigger or smaller than the required size, the image is currently stretched to fit into the app region.