Subject: x11 screenshot problem (xwdtopnm problem?)
To: None <>
From: Kazushi (Jam) Marukawa <>
List: current-users
Date: 12/02/2006 02:36:49

I tried to take a screenshot by "xwd -root | xwdtopnm |
pnmtopng" but the picture appeared as stretched like below.
I used a week or so old xsrc and pkgsrc/graphics/netpbm.

I also tried to use ImageMagick.  This worked fine like
below.  This is the screenshot what I tried to take.

Google has found following log from netpbm commit logs.
Not sure whether this problem is related to this log.

  Changes 10.11.15:
  * xwdtopnm: Doesn't work with at least one direct color 24 bits-per-pixel
    xwd generated by Xfree86's Xwd.

Few more additional info:

# xwdtopnm -verbose screenshot.img
xwdtopnm: Input is X11
xwdtopnm: Header is different endianness from this machine.
xwdtopnm: 768 rows of 1024 columns with maxval 65535
xwdtopnm: padright=341.  visualclass = DirectColor. format=20531 (P3)
xwdtopnm: bits_per_pixel=24; bits_per_item=32
xwdtopnm: byte_order=LSBFirst; bit_order=LSBFirst
xwdtopnm: red_mask=0x00ff0000; green_mask=0x0000ff00; blue_mask=0x000000ff
xwdtopnm: writing PPM file

# xwininfo -root
xwininfo: Window id: 0x3a (the root window) (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1024
  Height: 768
  Depth: 16
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 1024x768+0+0

Any idea?  Thanks.

-- Kazushi