\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#198: Image Command XPM Extension}
\date{May 12, 2004}
\author{R. Timothy Edwards, Don Porter, Kevin Kenny}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#198}&\textbf{Image Command XPM Extension}\\\hline
Author&

R. Timothy Edwards \tipmail{tim}{stravinsky.jhuapl.edu}
\par
Don Porter \tipmail{dgp}{users.sf.net}
\par
Kevin Kenny \tipmail{kennykb}{acm.org}
\\
Created&Wednesday, \(\text{12}^{\text{th}}\) May 2004\\
Type&Project\\
Tcl Version&\(8.7\)\\
State&Draft\\
Vote&Pending\\
Version&\tipversion$Revision: 1.6 $\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

This TIP proposes an extension to the Tk \textbf{image} command to incorporate color pixmap images based on the XPM format. The format is analogous to the \textbf{bitmap} option (\textit{tkImgBmap.c} in the Tk source).
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

The ``XPM'' format has become more-or-less a standard, and is a nice text-readable color alternative to the standard X11 bitmap format. The runtime library for XPM is available in standard Linux distributions and elsewhere. Tk has a number of color \textbf{photo} image formats, but these make various assumptions about rendering. There is no color alternative to the simple pixel-based bitmap format.

\section{Specification}

This TIP specifies the extension of the \textbf{image} command in the following manner:

\begin{quote}
\textbf{image create xpm} \textit{name} \textbf{-file} \textit{xpm\_file}
\end{quote}

It would probably be a nice idea to include in-line pixmap specifications similar to that allowed for bitmaps by the BLT package. However, at this time, the reference implementation does not include such an extension.

\section{Reference Implementation}

There is an implementation in the source for XCircuit[\url{http://xcircuit.ece.jhu.edu/}]. The source file is ``tkPixmap.c''.

\section{Comments}

I'd like to see more justification in this proposal as to why a new image type is needed, rather than implementing a suitable format for either the existing bitmap or photo image types. 

In fact, the Img extension already has XPM as a photo image format. I'm quite baffled as to the need for a new image type. Is this TIP better served by a request to promote XPM to the core set of supported formats?

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
