This weekend I finally sat down and wrote a screenshot effect for KWin. This effect redirects the rendering of any window into an off-screen texture and saves the texture into the home directory. The advantage of this effect is that it is hooked into the normal rendering process and so we can also capture the shadow and the translucency to get beautiful screenshots. If we capture a transparent window it does not show the windows below but only the captured window with the alpha channel turned on correctly. See for example:
|Translucent Konsole with Oxygen shadows|
Of course the effect is not meant to replace KSnapshot. Instead I prepared a patch which allows KSnapshot to use this effect when the user selected window under mouse cursor. The screenshot shown above was captured with this change to KSnapshot. I hope I will be able to merge this change, soon 🙂
Powered by Blogilo
20 Replies to “Beautiful Screenshots”
Perfect. Up until know I re-added shadows in GIMP to make screenshots look right again.
Seeing as I have to write an application manual (lots of screenshots) pretty soon: Is this patch available somewhere to test?
Yes the effect to just save a screenshot of active window is in trunk and the other patch lives in reviewboard.
Oh! I love taking screenshots of KDE4… with this patch, my screenshots will be extra cool!
This beats Windows alt+prtsc hotkey command all the way!
Yay, keeping the shadows looks great!
I always take a screenshot using region and placing the window over another blank window to keep them, so yay for not having to use this hacky workaround 🙂
We Rock, Just one last request, Martin in this particular case I think the unactive version of the shadow would be better….
@IAnjo this is better as its with true alpha in the shadow area so you can really do some nifty tricks 😀
You just have to screenshot inactive windows 🙂 Doing that programmatically is most likely impossible as it’s part of the decoration and not the effect
Hey ! It gives me an idea : maybe using this code it would be easy generate an aurorae windeco from an existing window. You ‘just’ have to store the bitmaps with transparency as png embedded in the svg theme file. The dificult part would be to know where the boundaries are.
Actually, I was thinking about a script to generate an aurorae theme from a dekorator theme. This would be possible. But the above idea would be more generic
Using bitmaps in Aurorae is kind of stupid. Aurorae is for scalable graphics. If you want to use bitmaps, use dekorator.
well , you could just ask me of a nice konsole screenshot 🙂
-> my screenshot in 2010 gentoo contest
what are u using for the window transparency?
The Konsole? That’s configurable in the profile
ps … i know my previous post is completly offtopic with your blog content 🙂 sorry
yeah , it will be nice to screenshot an window properly
Wow. It’s true! Kwin developers really *are* sexier and more awesome! 😉
/me is hoping we’ll get the screen record plugin back some day (albeit recording to theora or suchlike). Still, this is a fab step forward. Thanks Martin!
/me is hoping we’ll get the screen record plugin back some day
If I had any idea about encoding…
I’m probably just speaking nonsense, but can’t you just save the output of kwin to a raw video file in /tmp?
So other apps (like recorditnow or kdenlive) can just use kwin’s screen record plugin to do the actual recording instead of recordmydesktop (if the plug in is on of curse) and encode it afterwards.
Like the plugin you wrote for the beautiful screenshots.
I probably wont use it ever, but details like this would make kde even better especially if we want to compete against mac os X.
PS I’m really glad developers such as yourself contribute to KDE.
and BTW Kwin is the best WM out there IMHO, congratulations
Does anybody know how to obtain a screenshot as a vector graphic?
There actually exists a way for Gnome and I think it is just awesome, especially if you want to use the snapshot for a digital publication. In my humble opinion, SVG support together with the method presented here would make KSnapshot an optimal utility.
a screenshot is pixel data – there is no way to get vector data from it.
Comments are closed.