If you have already the converted PDF files, here's a version that works with all engines:
\documentclass{article}
\usepackage{graphicx,stringenc}
\usepackage{xparse,l3regex}
\ExplSyntaxOn
\tl_const:Nn \c_coloremoji_dir_tl { ./emoji_images/hires }
\tl_new:N \l_coloremoji_input_tl
\cs_new_protected:Npn \coloremoji_unicode:nn #1 #2
{
\includegraphics[#1]{\c_coloremoji_dir_tl / \int_to_Hex:n{`#2}.pdf}
}
\cs_new_protected:Npn \coloremoji_eightbit:nn #1 #2
{
\StringEncodingConvert \l_coloremoji_input_tl
{ \tl_to_str:n { #2 } } { utf8 } { utf32 }
\tl_set:Nx \l_coloremoji_input_tl { \pdfescapehex\expandafter{\l_coloremoji_input_tl} }
\regex_replace_once:nnN { \A 0* } { } \l_coloremoji_input_tl
\includegraphics[#1]{\c_coloremoji_dir_tl / \l_coloremoji_input_tl.pdf}
}
\NewDocumentCommand{\coloremoji}{O{}m}
{
\bool_if:nTF { \xetex_if_engine_p: || \luatex_if_engine_p: }
{
\coloremoji_unicode:nn { #1 } { #2 }
}
{
\coloremoji_eightbit:nn { #1 } { #2 }
}
}
\ExplSyntaxOff
\begin{document}
\coloremoji{}
\end{document}
Compile with pdflatex, XeLaTeX or LuaLaTeX. Change the meaning of \c_coloremoji_dir_tl to point to the directory where the PDF files are.
This is a pdftex only solution:
\documentclass{article}
\usepackage{stringenc,graphicx}
\makeatletter
\newcommand{\gethex}[1]{%
\StringEncodingConvert{\gh@tmp}{\detokenize{#1}}{utf8}{utf32}%
\edef\gh@tmp{\pdfescapehex\expandafter{\gh@tmp}}%
\expandafter\get@hex\gh@tmp\get@hex
}
\def\get@hex#1{%
\if0#1%
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\get@hex}{\get@hex@aux#1}%
}
\def\get@hex@aux#1\get@hex{%
\def\gh@string{#1}%
}
\newcommand{\coloremoji}[2][]{%
\gethex{#2}%
\includegraphics[#1]{./emoji_images/hires/\gh@string.pdf}%
}
\makeatother
\begin{document}
\coloremoji{}
\end{document}
A version without stringenc that works with all engines. Note that the argument to \coloremoji must be a single Unicode character. The \newunicodechar part is just to show compatibility. The optional argument to \coloremoji is passed to \includegraphics.
\documentclass{article}
%\usepackage[utf8]{inputenc} % not necessary, but recommended if pdflatex is used
\usepackage{graphicx}
\usepackage{xparse}
\usepackage{newunicodechar}
\newunicodechar{}{\coloremoji{}}
\ExplSyntaxOn
\NewDocumentCommand{\coloremoji}{O{}m}
{
\coloremoji_unicode:nn { #1 } { #2 }
}
%%% the location where the images are found
\tl_const:Nn \c_coloremoji_dir_tl { ./emoji_images/hires }
\cs_new_protected:Npn \coloremoji_unicode:nn #1 #2
{
\includegraphics[#1]{\c_coloremoji_dir_tl / \manual_get_hex:n { #2 }.pdf}
}
\cs_new:Npn \manual_get_hex_unicode:n #1
{
\int_to_Hex:n { `#1 }
}
\cs_new:Npn \manual_utfviii_to_unicode:n #1
{
\tl_if_blank:oTF { \tl_to_str:n { #1 } }
{ 20 }
{ \__manual_utfviii_to_unicode_aux:o { \tl_to_str:n { #1 } } }
}
\cs_new:Npn \__manual_utfviii_to_unicode_aux:n #1
{
\int_case:nn { \tl_count:n { #1 } }
{
{1}{ \int_to_Hex:n { `#1 } }
{2}{ \__manual_utfviii_twobyte:f { #1 } }
{3}{ \__manual_utfviii_threebyte:f { #1 } }
{4}{ \__manual_utfviii_fourbyte:f { #1 } }
}
}
\cs_generate_variant:Nn \__manual_utfviii_to_unicode_aux:n { o }
\cs_new:Npn \__manual_utfviii_twobyte:n #1
{
\__manual_utfviii_twobyte_aux:nn #1
}
\cs_generate_variant:Nn \__manual_utfviii_twobyte:n { f }
\cs_new:Npn \__manual_utfviii_twobyte_aux:nn #1 #2
{
\int_to_Hex:n { (`#1-192)*64 + (`#2-128) }
}
\cs_new:Npn \__manual_utfviii_threebyte:n #1
{
\__manual_utfviii_threebyte_aux:nnn #1
}
\cs_generate_variant:Nn \__manual_utfviii_threebyte:n { f }
\cs_new:Npn \__manual_utfviii_threebyte_aux:nnn #1 #2 #3
{
\int_to_Hex:n { (`#1-224)*4096 + (`#2-128)*64 + (`#3-128) }
}
\cs_new:Npn \__manual_utfviii_fourbyte:n #1
{
\__manual_utfviii_fourbyte_aux:nnnn #1
}
\cs_generate_variant:Nn \__manual_utfviii_fourbyte:n { f }
\cs_new:Npn \__manual_utfviii_fourbyte_aux:nnnn #1 #2 #3 #4
{
\int_to_Hex:n { (`#1-240)*262144 + (`#2-128)*4096 + (`#3-128)*64 + (`#4-128) }
}
\bool_if:nTF { \xetex_if_engine_p: || \luatex_if_engine_p: }
{
\cs_set_eq:NN \manual_get_hex:n \manual_get_hex_unicode:n
}
{
\cs_set_eq:NN \manual_get_hex:n \manual_utfviii_to_unicode:n
}
\ExplSyntaxOff
\begin{document}
\coloremoji{}
\coloremoji[width=1cm]{}
\end{document}

\coloremoji{...}– egreg Aug 05 '14 at 16:04newunicodecharby doing\newunicodechar{}{\coloremoji{}}, but this needs knowing the characters one wants to use. – egreg Aug 05 '14 at 16:24:)– Paulo Cereda Aug 06 '14 at 11:13