TIP #166 Version 1.2: Reading and Writing the Photo Image Alpha Channel

This is not necessarily the current version of this TIP.


TIP:166
Title:Reading and Writing the Photo Image Alpha Channel
Version:$Revision: 1.2 $
Author:Donal K. Fellows <donal dot k dot fellows at man dot ac dot uk>
State:Draft
Type:Project
Tcl-Version:8.5
Vote:Pending
Created:Wednesday, 19 November 2003
Keywords:Tk, image get, image put

Abstract

This TIP describes how to update the image get and image put subcommands so as to allow script-level access to the full alpha channel information that has been present in the photo image data model since Tk 8.3.

Rationale

Alpha channels. We've had them in Tk's photo image data model (which is currently 8-bits-per-channel RGBA) for quite some time now. We can copy the alpha data around inside the image. We now display them correctly on deep-enough displays (many thanks to the people who have worked on that!) But can we write alpha data into an image? No. Not unless you have an image format handler that produces alpha data installed (e.g. the PNG from tkimg.) I think we should fix this so that people can read and write the full alpha data from scripts.

Proposal

I propose to update the photoImageInstance get subcommand so that it returns four values instead of three, with the fourth being the contents of the alpha channel for the pixel.

I also propose to update the photoImageInstance put subcommand so that alpha channel information may be specified in the following ways when using the list-of-lists-of-pixel-data format (the image-format format will be up to the particular image format code, as always.)

Open Questions

What about the photoImageInstance transparency subcommand?

Reference Implementation

Nothing yet.

Copyright

This document is placed in the public domain.


Powered by TclThis is not necessarily the current version of this TIP.

TIP AutoGenerator - written by Donal K. Fellows