# .toImage(str)

## convert native unicode emoji and shortnames directly to images

This function is simply a shorthand for .unicodeToImage(str) and .shortnameToImage(str). First it will convert native unicode emoji directly to images and then convert any shortnames to images. This function can be useful to take mixed input and convert it directly to images if, for example, you wanted to give clients a live preview of their inputted text. Also, if your source text contains both unicode characters and shortnames (you didn't unify it) then this function will be useful to you.

Feel free to enter native unicode emoji and/or shortnames in the input below to test the conversion process. For a complete list of emoji and their shortnames check out emoji.codes.

### Input:

### Output:

### JS Snippet:

        // <input type="button" value="Convert" onclick="convert()"/>

        <script type="text/javascript">
       function convert() {
            var input = document.getElementById('inputText').value;
            var output = emojione.toImage(input);
            document.getElementById('outputText').innerHTML = output;
        }
        </script>