berlin104
berlin104

Reputation: 35

Black screenshot taken with 'import' (ImageMagick)

I have a curious phenomenon.

I have a script which contains this line:

import -frame IMG_$(date +%Y%m%d_%H%M%S).png

So, a screenshot of an area can be taken. Sometimes it appears that parts of the screenshot are black (see sample image):

sample http://2imgs.com/2i/i/54c0fab6/e245ab35e0aa18c44354d04e40c908d5/77780d27f4.f.png

Does anyone have an idea why this behavior occurs?

Upvotes: 2

Views: 975

Answers (1)

Kurt Pfeifle
Kurt Pfeifle

Reputation: 90213

I'm not sure if this is a correct answer. You have to test it...

I myself have no personal experience in using import for screenshooting X11 screens.

My suspicion is that the black area comes from transparent sections in the X11 window. So you need to pick or enforce an output format that supports transparency (or alpha channel). That's where my suggestion comes from:

import -frame PNG32:IMG_$(date +%Y%m%d_%H%M%S).png

The PNG32: prefix to the file name should be forcing 32-bit PNG (which includes as a fourth channel the alpha channel.

Upvotes: 2

Related Questions