I want to capture a window as a png from within a bash script, using the window's ID. In this case, the window is the top panel. Using gnome-screenshot
the colours are true, as per this image... (this image is not the same size as the following image, so ignore the dark line at the bottom)
However when I capture the panel via import
, or xwd
+ convert
, I get the following image..
Why would I be getting this colour aberration?
import
and convert
both belong to the imagemagick
package...
I haven't found anything else in the Ubuntu repository which can capture a window by its ID... so I'm stuck. (gnome-screenshot
doesn't have the feature)...
It would be nice to know what is going on here (eg, is is something to do with transparent images, which I know very little about)...but in any case, just a recommendation of a workaround capture utility may do the trick ... it must be able to capture a window by it's ID.
Here is an example of how I make and view the image capture.
import -window "$(wmctrl -l |grep "Top Expanded Edge Panel" |awk '{print $1}')" screen.png
display screen.png
ldd /usr/bin/program-that-displays-that-window
andxdpyinfo
might give some hint. – Gilles 'SO- stop being evil' Jul 06 '11 at 21:20import -window "$(wmctrl -l |grep "Top Expanded Edge Panel" |awk '{print $1}')" screen.png; display screen.png
... – Peter.O Jul 06 '11 at 23:15