Zwabel’s Weblog

April 6, 2009

KDE for Painters

Filed under: KDE — zwabel @ 11:40 am
Tags: , , , , , ,

My mother is an artist(A painter, see website). Since me and my brother have to administrate her computer, and she’s using Windows XP, we always have to deal with all kinds of problematic implications that come from this. Linux is a lot better suitable for remote administration
, and since she’s already using Thunderbird and Firefox, one should think that this isn’t such a hard switch.

So we tried it, and we nearly got her go crazy. Because she was using Windows Explorer before to manage her pictures, she has accumulated a really strange structure for them: Hundrets of folders, each with between 5 and 50 pictures, and all in a flat tree, and all badly named.

There is only one way of keeping at least a minimum level of overview in this mess: By recognizing the content of the folders using folder previews. Although this isn’t such a complicated thing, there seems to be no linux file manager that has this feature, until now.

I’ve implemented this feature within the KDE preview generator, so it works within all KDE applications now:
Isn’t it beautiful? Actually, the fact that it is beautiful is due to Peter Penz, who put the previews into the folder icon after I implemented the actual previewing. Now all we need is some more speed in preview generation, and it would be perfect.

This is one of the killer features my mother needs, and there is one more. She usually takes photographs of her paintings. The photographs tend to also show the borders, and are never perfectly even. Now there is a proprietary application on windows where you can just select the borders, and have the application perfectly map the picture into a rectangular and correctly scaled form.

Gimp comes relatively close to this with its inverse perspective transform tool, but it doesn’t change the pixel-size of the image to correctly reflect the size of the selected rectangle. Also it is a too complicated tool for such simple tasks.

However digikam also has a perspective transform tool in showfoto, and showfoto seems generally to be a very good and simple application for doing simple image adjustments like brightness/contrast etc., so this application would be a perfect match. However that tool also didn’t support inverse transform and resizing the image to the content yet.

Since it as well lives in the KDE source tree, this was also a simple attacking point for me. Here you can see the result, already present in the current digikam beta release:
Here you select the area that will be inversely mapped into a rectangular shape(I didn’t have an actual painting available):
And the result:

So to make it short: If you’re a painter, then KDE 4.3 is for you. 🙂


  1. Hugin also can do perspective corrections, but it’s probably too complicated for this simple use case.

    Comment by David — April 6, 2009 @ 12:09 pm

  2. Let me guess: You forgot to add preview capabilities for RAW images. 🙂 (digiKam/showFoto are able to do this, Dolphin and GwenView in 4.2 not) 🙂

    Comment by Markus — April 6, 2009 @ 12:31 pm

  3. @Markus: If there is a KIO plugin to do that, then it should work. Possible that digikam/showfoto has some own code for this though.

    Comment by zwabel — April 6, 2009 @ 12:33 pm

  4. That folder preview stuff looks both nice and useful. 🙂

    Comment by Svempa — April 6, 2009 @ 12:41 pm

  5. Wow – that folder preview is a really useful feature!

    *thumbs up*

    Comment by Niko Sams — April 6, 2009 @ 12:48 pm

  6. Thanks for this beautiful feature, I just built KDE from SVN and I’m already enjoying it 😉

    Comment by Enrico Ros — April 6, 2009 @ 1:06 pm

  7. Very nice!

    thank you

    Comment by peter — April 6, 2009 @ 1:22 pm

  8. I’m using the same feature we’ve got in Krita (although the usability is a bit limited) to straighten out pics I made from paintings in museums.

    Comment by Boudewijn Rempt — April 6, 2009 @ 1:41 pm

  9. You’re my hero! The work you do on KDevelop is amazing, and this rocks too!

    Comment by Erlend — April 6, 2009 @ 2:00 pm

  10. Folder icon preview is a killer feature 🙂
    Now you can set to fixed this:

    Comment by Javier García — April 6, 2009 @ 2:13 pm

  11. Yeah I think previewjob and thumbnail could need some love regarding optimisation. E.g. i’m not sure if we need the QImage -> Pixmap -> QImage conversion (see #ifndef USE_KINSTANCE). But it’s all a bit confusing, at least for me.

    Comment by Andre — April 6, 2009 @ 2:15 pm

  12. Nice work!
    Visually, it might be nice if the preview were to adjust perspective to the folder icon: The front of the folder looks like it is leaning towards the viewer, but the images on the cover of the folder are not. I know this is hard to do in practice, if only because different icon themes have different perspectives. 🙂

    On the projection: great work, but maybe a different name would be in order? Why is it called “Inverse Transformation”? It is a transformation, but for me it is not clear what it is the inverse of…

    Comment by Andre — April 6, 2009 @ 2:19 pm

  13. Nice!

    I remember a discussion about the Images-in-folders stuff somewhere in a blog or mailing list.
    The problem: What if the user uses a different icon theme? The previews are very likely to be drawn at a wrong position…

    For the “inverse transformation”, very nice feature! But just from the name “inverse transformation” I would never think of cropping the image afterwards. How about naming it “crop image after transformation” or something like this?

    Comment by Robin — April 6, 2009 @ 2:20 pm

  14. @Andre 2, Robin:
    It’s a “perspective transformation”, and usually it’s used to apply a perspective on the picture.
    The inverse transformation of it does exactly the opposite: It removes the perspective, making it flat again. Thus the name “Inverse Transformation” matches it quite well.

    Comment by zwabel — April 6, 2009 @ 2:24 pm

  15. I did some finetuning for the previews in the meantime:

    – The alignment of the previews within the folder has been done in a way to use as much space as possible (in the screenshots some previews are very tiny). Beside having not so tiny previews anymore, it also looks less cluttered now.

    – The performance is a little bit faster now, as KFilePreviewGenerator requests an optimized size for the folders. Still it is not as fast as having cached previews of one file 😦

    Comment by Peter Penz — April 6, 2009 @ 2:25 pm

  16. Thank you so much! I’ve wanted this folder preview for months! 🙂

    The perspective correction sounds fantastic, I’ll have to give that a try too.

    Comment by Angel Blue01 — April 6, 2009 @ 2:25 pm

  17. *both thumbs up* for both features 🙂

    Comment by mattie — April 6, 2009 @ 3:04 pm

  18. @Andre

    The trouble is doing something like that would necessarily assume that the icon being used had that particular perspective. (1) this assumes the Oxygen theme is being used and (2) this means that if the oxygen theme is changed it would require the preview stuff to be changed separately.

    For a proper separation of theming I guess the icon theme should define a rectangle (or quadrilateral if you want to allow for skew) onto which previews could be painted.

    In fact I guess for SVG icons the best way to do it is to substitute some transparent element in the SVG with the preview and allow the SVG painter to do the rest. This would allow the theme to define exactly how the preview is painted (for example painting a photo sticking half-way out of a folder, or having it visible though a translucent folder).

    Comment by maninalift — April 6, 2009 @ 4:44 pm

  19. It’s nice but I actually like more how Vista provides those previews… You know inside the folders icon. It makes more sense since pages are in fact inside folder and not on it ….

    No it’s not a flame and I’m not a Ms Windows enthusiast, I’m just voicing an opinion. This is how it looks in Vista :

    and AFAIK it isn’t limited just for pictures but works for docs and other files too …. That’s actually one of a few things about Vista that I consider good.

    Comment by val-gaav — April 6, 2009 @ 6:06 pm

  20. @val-gaav: Yes it looks nice in Vista, but that’s purely cosmetic, and in the end you see less.

    Comment by zwabel — April 6, 2009 @ 6:12 pm

  21. Nice work, but I have to agree with val-gaav. When I saw the preview in Vista I really liked it. And I think that you actually see more in Vista. You don’t see the whole picture, that’s true, but you see part of it bigger. I don’t need to see exactly the whole picture to figure out which one it is, I just need to see it bigger and recognize somethiung in it.

    The theme icon is a major problem, though. I think this is a nice first step, but for me this feature is not done yet.

    I hope you don’t take it as a destructive criticism

    Comment by Firmo — April 6, 2009 @ 7:38 pm

  22. @Firmo: So to you, a feature is done only when it is exactly like in Vista? Great..

    To me, it is done. If someone else wants to improve it, fine. That would be mainly a job for theme designers, and would need an improved theming system.

    Comment by zwabel — April 6, 2009 @ 7:48 pm

  23. maybe the previews can be of zoomed & cropped parts of the original images, this would make them more likely to contain the ‘interesting’ bits of the images, rather than all of the borders etc. (like facebook does thumbnails)

    Comment by vespas — April 6, 2009 @ 8:22 pm

  24. @vespas: That would only make sense if there was also some software that analyzes the image to detect interesting parts. Would be quite expensive though.

    Comment by zwabel — April 6, 2009 @ 8:27 pm

  25. What kind of color theme do sou use? That green is….to awful for words;)

    Nice to seem that this finally gets implemented. But it is kinda sad, that it just needed your mother to get you doing this. Those feature requests in Bugzilla and over in the Brainstorming section were kinda useless. But hey, now there is a proven way to get your feature request implemented. Let David Noldens Mother talk to him. -.-

    Comment by Burke — April 6, 2009 @ 9:05 pm

  26. @Burke: Should I feel sorry now?

    Comment by zwabel — April 6, 2009 @ 9:12 pm

  27. #IFDEF out Burke in the sources. =P

    Comment by anon — April 6, 2009 @ 9:26 pm

  28. Thanks for inverse transformation feature. It covers 90% of my needs. For 8% I have to use normal perspective transformation and for last 2% I use Hugin 🙂

    Comment by vvaz — April 6, 2009 @ 9:51 pm

  29. @zwabel

    No, it is done when there are no apparent rooms for improvements.

    Right now we have another file manager which shows the preview in a prettier and better way (at least for some share of the user base, at least myself). Doesn’t matter if it’s the Microsoft way, the Apple way or the Gnome way.

    Comment by Firmo — April 6, 2009 @ 11:04 pm

  30. @Firmo: A Volkswagen is not as pretty as a Porsche, still it is a finished car. Unless you or someone else are planning to extend this, it is finished.

    Comment by zwabel — April 6, 2009 @ 11:41 pm

  31. Great job. I hope that there is an option in dolphin/file dialogs or at least in a apprc file to turn it off, but other than that, great 🙂

    Comment by Andrew Stromme — April 7, 2009 @ 2:10 am

  32. A frame like the normal preview and black border for irregular image or something like that would be nice. Just add a black 3×4 ratio with 1px gray 30%, 1px gray 50% or 10% and one last 1px gray 30% around that black frame then draw the preview over it, it will do the job. I used it and currently it look really bad (but I am happy to have that feature).

    It doesn’t need to be a black background, but just something to make the 4 item less irregular, asymmetry is normally more eye catching than symmetry, and this is not a good thing this time. You don’t want the user to see only the preview and see irregularities.

    Just an opinion by the way, thank for both for this feature.

    Comment by Emmanuel Lepage Vallée — April 7, 2009 @ 2:20 am

  33. Cool!

    Comment by EUvin — April 7, 2009 @ 7:03 am

  34. I agree that the vista ones look better, however they are less useful and need larger icons – doesn’t work with small ones like the default dolphin icons. So I wouldn’t copy it. I’d say it’s finished now, until somebody does indeed want to go through the effort of changing the whole icon format etc…

    Comment by jospoortvliet — April 7, 2009 @ 7:11 am

  35. Great work! Thank you very much for it!

    But is there option to disable these folder previews? If not, please can you add it? I can imagine cases where someone would want to disable it…

    Comment by mmmm — April 7, 2009 @ 7:34 am

  36. Nearly every application that does thumbnails allows to disable this, by disabling thumbnails for the mimetype “Directories”.

    Comment by zwabel — April 7, 2009 @ 8:37 am

  37. I did some tests with svn version of digiKam and it does great job. But one thing requires IMO more attention – it should be better in guessing of proportions of “unperspectived” fragment. Even in your example – you selected visibly rectangular area buy output is almost square. Thanks.

    Comment by vvaz — April 7, 2009 @ 8:47 am

  38. @ywaz: Yes, it maybe could do a better job in this. But I think it’s not possible to reliably guess the real proportion, because you never know whether what parts of the proportion come from the perspective transformation, and what is part of the image.

    So it just takes the bounding-rect of the transformed version right now.

    Comment by zwabel — April 7, 2009 @ 8:55 am

  39. Emmanuel Lepage Vallée: That’s wrong, human eyes are trained to recognize _regularities_, not _irregularities_. So the regular layout is a bigger problem than the irregularities in its content.

    Comment by zwabel — April 7, 2009 @ 3:05 pm

  40. […] KDE for Painters My mother is an artist(A painter, see website). Since me and my brother have to administrate her computer, and […] […]

    Pingback by Top Posts « — April 8, 2009 @ 12:19 am

  41. Just a question regarding the folder-previews: would it be possible to add some sort of emblem showing whether the folder has sub-folders? I know quite a few people with sort of the same “organizing” behaviour as described above it would help immensly.

    Comment by Jonas — April 9, 2009 @ 1:08 pm

  42. Very nice. Like 4.2 a lot but hate some things, like some slowness and instability (in 4.2.0). Hope 4.3 comes more stable and faster and with more customizability (especially an option to disable virtual desktops changing while moving wheel (argh!!) someone did file a bug for it though).

    Comment by currently gnome user — April 9, 2009 @ 4:14 pm

  43. […] for Painters, Version 2.0 Filed under: KDE — zwabel @ 8:41 pm When I did my last blog post, there were some comments that said that the folder previews didn’t look as nice as they […]

    Pingback by KDE for Painters, Version 2.0 « Zwabel’s Weblog — April 9, 2009 @ 8:42 pm

  44. […] Не без проблем, но они сделали это. […]

    Pingback by KDE для художников « — April 14, 2009 @ 11:23 am

  45. I just installed KDE 4.3 beta 2 on Kubuntu and the feature got integrated. Congrats and it’s a nice improvement. Unfortunately now all of my individually selected Icons per folder disappear if the folder contains an image. They flicker up shortly then they revert back 😦 I use a lot of individual icons for my folders in the home directory since they are easier to detect for my eyes. Does anyone have more information on this?

    I nope next is KDE for musicians – preview of sound files and quick analysis of the waveform !!! Naaa – just dreaming 🙂

    Comment by Thomas Meixner — June 12, 2009 @ 4:47 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

%d bloggers like this: