WinPhoto works fine here. It sounds like a Fedora bug. Are you using the latest Tk, or the binary one provided by Fedora? This script works fine here.
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::WinPhoto; use Tk::JPEG; my $image = shift || 'zen16.jpg'; #test image colors my $mw = tkinit; $mw->geometry("200x400+100+100"); my $canv; my $mainbutton = $mw->Button(-text=>'MainWindow Capture', -command => \&mw_capture, )->pack; my $canvbutton = $mw->Button(-text=>'Canvas Capture', -command => sub{ &canv_capture}, )->pack; $canv = $mw->Scrolled('Canvas', -width=>2400, -height=>3400, -scrollregion=>[0,0,2400,3400], -scrollbars=>'osoe') ->pack(-fill=>'both', -expand=>1); my $img = $mw->Photo(-file => $image ); $canv->createImage( 0, 0, -image => $img, -anchor => 'nw' ); # Create line inside the canvas upper area $canv->create ('line',1, 1, 3000, 3400, -fill=>'red'); $canv->createRectangle(10,20,30,40, -fill=>'blue' ); # Create line inside the lower area $canv->createRectangle(400,400,800,800, -fill=>'blue' ); # Create line inside the lower right area $canv->createRectangle(2000,3000,3000,3400, -fill=>'blue' ); MainLoop; ######################################################### sub mw_capture{ my $image = $mw->Photo(-format => 'Window', -data => oct($mw->id) # # -data => oct('0xa00022') # -data => oct($id) ); my $pathname = $0.'-mainwindow.'.time.'.jpg'; $image->write($pathname, -format => 'JPEG'); } ########################################################## sub canv_capture{ #$canv->configure(-height=>2400, -width =>3400); #$mw->update; my $image = $mw->Photo(-format => 'Window', -data => oct($canv->id) ); my $pathname = $0.'-canvas.'.time.'.jpg'; $image->write($pathname, -format => 'JPEG'); } ##############################################################

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: Tk Canvas WinPhoto Colors are changed in jpg by zentara
in thread Tk Canvas WinPhoto Colors are changed in jpg by rickrutgers

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.