TIP 198: Image Command XPM Extension

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2017 Conference, Houston/TX, US, Oct 16-20
Send your abstracts to tclconference@googlegroups.com
by Aug 21.
Author:         R. Timothy Edwards <tim@stravinsky.jhuapl.edu>
Author:         Don Porter <dgp@users.sf.net>
Author:         Kevin Kenny <kennykb@acm.org>
State:          Draft
Type:           Project
Vote:           Pending
Created:        12-May-2004
Post-History:   
Tcl-Version:    8.7

Abstract

This TIP proposes an extension to the Tk image command to incorporate color pixmap images based on the XPM format. The format is analogous to the bitmap option (tkImgBmap.c in the Tk source).

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 photo image formats, but these make various assumptions about rendering. There is no color alternative to the simple pixel-based bitmap format.

Specification

This TIP specifies the extension of the image command in the following manner:

image create xpm name -file xpm_file

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.

Reference Implementation

There is an implementation in the source for XCircuithttp://xcircuit.ece.jhu.edu/ . The source file is "tkPixmap.c".

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?

Copyright

This document has been placed in the public domain.

History