Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

O most noble Monks,
I am trying to use the "Photo" widget in Tk, and it's giving me some problems. Here is my code:
#!/usr/local/bin/perl -w use strict; use Tk; my $mw = MainWindow->new; my $image = $mw->Photo(-file => 'Xcamel.gif', -format => 'gif'); $mw->Label(-image => $image)->pack; MainLoop;
The picture is included in the Tk distribution (it's right in the Tk directory). When I look at Xcamel.gif using xv (or a web browser), it shows up with all of the available colors. When I use perl/Tk, it is horribly dithered. I tried experimenting with the "-palette" option on the Photo widget, but to no avail. I am using Perl 5.00503 on Sun/Solaris, and Perl/Tk 800.015. I appreciate any help you can give me. Thanks!
Julio

Replies are listed 'Best First'.
Re: Perl/Tk color dithering
by rjray (Chaplain) on Sep 17, 2002 at 03:05 UTC

    If I recall correctly (it's been a while since I wrote any Perl/Tk applications), the dithering is handled internally by the Tk code itself, leaving you very little control over it.

    For a question this detailed and specific, I would recommend contacting the module's maintainer (e-mail address should be in the documentation), or joining the Perl/Tk mailing list. Info on that list is on the page for the Perl/Tk Module List.

    --rjray