Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1587 image put errors on {} color

obsolete: 8.4.4
open
7
2005-12-15
2003-10-25
Jeffrey Hobbs
No

image put dies when passed "" as a color, although this
can be used in various other places in Tk to mean
an "empty" color or transparent color. image put should
do the same, so you can pass in large color arrays that
don't specifically have to set a color for all pixels.

Discussion

  • Logged In: YES
    user_id=79902

    Q1: Does this require a TIP to fix?
    Q2: Should the empty string indicate that a pixel is to be
    ignored or that a pixel is to be made transparent?

     
  • Patch

     
    Attachments
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2003-10-28

    Logged In: YES
    user_id=72656

    1. It requires a TIP if you view it as not a bug.
    2. This may justify it more as TIP-worthy.

     
  • Logged In: YES
    user_id=79902

    I've been thinking about this a bit more, and I feel that
    the empty string ought to represent a transparent pixel, and
    not a pixel that should be ignored when writing into the
    image. The idea is that you are putting a blank into the image.

    OTOH, I might do a TIP for all this anyway so that I can add
    a syntax for specifying non-trivial transparency at the same
    time.

     
  • Logged In: YES
    user_id=493507

    Donal,

    Could you look at the last part of FR 557090 before TIP'ing,
    dealing with "xcolor@alpha" syntax ?
    Then, setting transparent pixel could be done with @0, and ""
    could denote a "do nothing" behaviour.

     
  • Logged In: YES
    user_id=79902

    It's *extremely* difficult to get both @0 and "" supported
    at the same time with different behaviour as you suggest.
    The problem is that setting a pixel to be transparent
    requires one kind of compositing rule (set) and ignoring a
    pixel requires another (overlay).

     
  • Logged In: YES
    user_id=493507

    You're right, I missed that.
    So, let "" raise an error and @xx deal with alpha ;)

     
  • Logged In: YES
    user_id=79902

    Wrong answer. Make the empty string work and make @xx throw
    an error instead. Which is as far as I could see myself
    going without a TIP (since arguably the empty string is
    already interpreted in Tk as transparent and alpha support
    is currently abysmal.)

     
  • Logged In: YES
    user_id=79902

    I'm going to do this in TIP#166 http://purl.org/tcl/tip/166
    as I want more complete control than just "{} ==
    transparent" anyway.

     
  • Logged In: YES
    user_id=493507

    Thank you Donal.

     
    • summary: image put errors on "" color --> image put errors on {} color