Home > Krita, Open Source > Darkroom 1.0 and Import Raw in Krita

Darkroom 1.0 and Import Raw in Krita

It all started on Friday when I had a look at the pictures I took in Berlin, during the KDE-Bindings meeting and on my way to the airport in the city center. I found them incredibly noisy, my digital camera is starting to age, it’s more than four years old, so I was wondering if it wouldn’t be a good idea to replace it. At first, I had decided to wait a little bit before buying a DSLR, but seeing how poorly hand-held camera still behave, yay they have more mega-pixels, but why is it useful if the results is completely noisy and blurry ? And you can’t tell yourself that you will buy one of the low mega-pixels camera, since they also have crap results, since they sell their product on the number of mega-pixels, no manufacturer will take the time of making a good hand-held camera, sad. So I turned myself to a DSLR (help with the fact that price have considerably dropped recently).

Since new babies are introduces with a picture:

I didn’t had time to use it much, but I still spend sometime yesterday afternoon taking pictures in Toulouse, but I already like it a lot, since I was able to concentrate on just taking pictures instead of spending time adjusting options, while still having the possibility to adjust them for extreme situation. Which is good, I am so used to take picture with a silver film, entry level camera Nikon F60, where the only things you can do is adjust the speed and aperture, which is about all you usually need.

Here is a view of the Capitole:

Darkroom 1.0

Back to the point, KDE applications, since that’s probably all you want to hear about. One of the usual feature of DSLR camera is the possibility to save pictures as RAW file, which is basically a dump of the sensor output to memory. To be precise, there is no such things as a RAW file format, there are about hundred of them, for each camera manufacturer, model and sensors.

Now that I have a camera with RAW, I want proper support for it in Krita and in my KDE environment. Especially that I was stupid enough to shot around 20 pictures as RAW files while I just wanted to have one or two for testing.

On unix, the main application to decode RAW files in something useful is dcraw. In the KDE side we have libkdcraw, which offers a front-end to a stable dcraw version (yes one of the bad side of dcraw is that it is not a library, but a command line tool whose option changes all the time) and a configuration widget. Using that library I told myself it would be easy to write a KDE based RAW decoder. Yes, I know there are already quiet a few of them, but Darkroom is like 400 lines of code, since all the logic is either in dcraw or in libkdcraw which is shared among KDE applications.

A few hours later, here is the result:

You can get it from my website if you want to play with it. I am not to sure about its future, one things is certain, I don’t want to invest much time in Darkroom, maybe on libkdcraw, or of course Krita, which would bring back improvements to Darkroom.

Import RAW in Krita

The next logical things to do is to get an importer for RAW in Krita, actually there was one in Krita 1.6, but did I mentioned that interfacing with dcraw sucked ? Well, that means the Krita RAW importer start stopping working and there was no one who had time to fix it and maintaining, that’s where using libkdcraw will help us, since the maintaining burden is shared (or currently delegated).

So a few minutes after Darkroom was finished, a new RAW importer from Krita was written (things are much easier when you know the API of a library):

I have some RAWorld Domination Plan for Krita, I am toying with the idea of editing the RAW file inside Krita instead of importing it, but that’s for an other time, maybe in a year or two.

  1. Tobias
    20 July, 2008 at 17:28

    Have you looked at libopenraw? I think it’s a nice alternative to dcraw.

  2. Cyrille Berger
    20 July, 2008 at 19:09

    Yes libopenraw is a nice alternative to dcraw, up to one detail, it can convert a raw file to an image. Currently, it can only extract the preview, and most likely the raw data.That said libopenraw is a nice project, I wish Hubert good luck with it. And hopefuly someday, we will be ablel to replace dcraw with openraw in libkdcraw.

  3. Gilles
    20 July, 2008 at 19:53

    Tobias, Cyrille.No. Libopenraw is not a suitable alternative for the moment. it’s an uncomplete library compared to dcraw interface.The good way is libraw (http://www.libraw.org) which provide already a full compatible and suitable api against dcraw. i will use this library in the future into libkdcraw to replace dcraw.Note than libraw already use last stable dcraw implementation…

  4. Raips
    21 July, 2008 at 06:25

    Does Krita now preserve and support photos metadata? Last time I checked, it removed them and that’s why Krita is not suitable for editing photos.I do all the photo editing on the digiKam (http://digikam.org) what keeps up that libkdcraw, because it has every option what photographer needs. I hope you krita guys would work more together with it, because it is greatest photo software available for Linux.

  5. Cyrille Berger
    21 July, 2008 at 07:15

    @raipsActually that was on my TODO for yesterday, but while working on it I blocked on a bug that ate four hours 😦 so I was only able to complete support for writting metadata to PNG.There are two bugs to follow how metadata are evolving in Krita:http://bugs.kde.org/show_bug.cgi?id=160446http://bugs.kde.org/show_bug.cgi?id=138923I am still unsure how well (if at all) metadata will be supported for TIFF in the next release. But for PNG and JPEG it should be ok.

  6. Gilles
    21 July, 2008 at 16:28

    For metadata writting in krita, the code from digiKam image loader can be used as reference especially for PNG and TIFF.Note that current implementation of Exiv2 is able to write metadata to TIFF on the fly. No neef to use libtiff for that, which lack Exif and makernotes support.About PNG metadata writing, i’m curenttly re-factoring Exiv2 PNG parser to be able to support writing on the fly. Gilles Caulier

  7. Cyrille Berger
    21 July, 2008 at 17:40

    I used digikam as a refernce for PNG writing 😉 Now my problem is reading, but I guess I will use imagemagick as a reference.As for by-passing libtiff (or libpng) it’s more a problem to me than an advantage.

  8. Gilles
    21 July, 2008 at 19:14

    There is no major problem to use libpng to write metadata to PNG. You save it at the same time than you write png image chunksFor tiff image, libtiff lack all Exif photo tags and all makernotes. Yes it’s a shame, but it’s a wrong conception of the library. It will be never fixed…To be universal, I recomend you to use the same way than digiKam : you write image file using dedicated library, and after you update all metadata (comment, Exif, makernotes, iptc, and xmp) using Exiv2. In digiKam we use libkexiv2 wrapper for that. It’s for fine, no need to re-invent the wheel…Gilles Caulier

  9. jramskov
    21 July, 2008 at 20:22

    Looks promising! A good tool for handling the workflow @ taking pictures in RAW is missing in the open source world. Digikam is great, but it is not particularly good for RAW pictures.

  10. Carlos
    6 December, 2008 at 04:05

    Being you a Krita developer I think you might be interested in several open source projects a small group of photographers and programmers are developing, and which code, or some parts of it, perhaps could be included in Krita in some future version or at least may be you can get some interesting ideas.So even if I don’t know a word about programming, nor I am any expert in digital photography either, just an aficionado, let me post some info:“Zero Noise” aims to be another HDR images making program, but not only increasing dynamic range but also reducing noise. There’s some HDR script for GIMP, but I don’t know for Krita (I haven’t been able to open a single jpg in 2.0 beta without a crash :-/ ), and as far as I know Gimp script only composes high dynamic range images, without any noise reduction. Despite I think “Zero Noise” is a name a bit too optimistic it seems a neat piece of software.“Histogrammar” makes 16 bit histograms in logaritmic scale, which in authors’ words represents “the scene’s real luminic distribution”, at least much more real than the common 256 level histograms. It also allows to use Ansel Adam’s and 16 aperture stops extended zone system to measure the scene’s distribution besides some useful statistical data.“Perfect Raw” is another RAW developer (based in dcraw as well) but, developers’ words, “not implementing any functions which don’t strictly concern RAW developing, leaving additional adjustements in Photoshop hands”. Very good in my opinion for simple and precise RAW developing, and absolutely nothing else (sharpness, contrast, whatever “extradeveloping” action), which could be a great RAW import plugin for Krita (yes I know Krita can import RAW, but could be “Perfect Raw” a better importer?.They have a couple more of programs related to photo edition, but I think these three are really interesting as components/comlements for an image editor.If you are somehow interested you can read more, and from their own words, at http://www.guillermoluijk.com/software/index.htm. The site is in spanish; being yourself a french speaker I suppose you can understand some written spanish, but for deeper and more detailed info I guess you can email them in english. Guillermo Luijk’s e-address is at the bottom of the page. I think he’s a photographer, not any of the programmers, but I guess he can provide you all the info you might want.Well, excuse me if this has sounded like spamming or something like that, nothing farther from my intention. I just honestly believe they are very interesting projects and in a decent degree of development which would make Krita a very singular program.Regards, and keep up the good work with Krita. Version 1.6 was very nice and 2.0 seems even better, at least that’s what people who can use it whithout continuous crashings say, hehe, ;p.Salut.

  1. No trackbacks yet.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: