[HJG] I have some images on a canvas, and I want to get the color of the pixel under the cursor. Right now, this works only for an image placed on the canvas at 0,0 : ---- package require Img proc int x { expr int($x) } proc ShowPixel {x y i} { set c "- - -" catch { set c [$::img1 get $x $y] } wm title . "$x $y #$i : $c" } set fn gosmall.gif set img1 [image create photo -file $fn] pack [canvas .c] .c create image 0 0 -image $img1 -anchor nw -tag Copy1 .c create image 80 80 -image $img1 -anchor nw -tag Copy2 bind .c { ShowPixel [int [%W canvasx %x]] [int [%W canvasy %y]] [%W find withtag current] } ---- The RGB-values of the pixel under the cursor are shown only for the first copy of the image... I can query the coordinates of an item/image on the canvas with ''bbox'' (to adjust coordinates within the image vs. the screen-coordinates given by the cursor), but how do I pass the item (as opposed to its id) to the proc ShowPixel ? [RS]: Pass in the widget name. For images you can retrieve the name as ''-image'' attribute. Sketch (missing the transposition of image coordinates yet): proc getColor {canvas x y} { set color "" set id [$canvas find withtag current] switch -- [$canvas type $id] { image {set color [[$canvas itemcget $id -image] get $x $y]} line - polygon - rectangle - oval { set color [$canvas itemcget $id -fill] } } return $color } ---- [Category Graphics] - [Category Image Processing]