Converting XWD -> BMP -> PNG (transparency problem)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
slackhead
Posts: 1
Joined: 2013-08-06T17:37:27-07:00
Authentication code: 6789

Converting XWD -> BMP -> PNG (transparency problem)

Post by slackhead »

I have a script that uses xwd to grab a screenshot, then convert converts in to png.

If I screenshot a terminal with a transparent background the resulting png loses it's transparency somehow. If I convert to bmp it works fine,but converting said bmp to png again loses its transparency. If I convert to gif it works, but the image quality is quite poor.

If I use the -root option of xwd everything works fine, but that takes a shot of the whole desktop with no prompting.

I've tried playing with -alpha options etc but not found anything that works. Any ideas?

I'm not using any options:

convert screen.xwd screen.bmp
convert screen.bmp screen.png

Here's an example made with xwd -root option: http://www.r0t.co.uk/sshots/shot-2821497685.png
And this is with coverted directly to png without the -root option, http://www.r0t.co.uk/sshots/shot-7284893223.png
If I convert to bmp and display it looks correct, but doesn't convert to png properly.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting XWD -> BMP -> PNG (transparency problem)

Post by fmw42 »

Can you provide a link to the xwd file so others can test with it?

What version of IM and platform are you using?
Post Reply