Discussion:
Astronomy work with Krita
Stephen Williams
2010-08-29 23:03:30 UTC
Permalink
I'm planning to do so image stacking/composition plugins for some
image processing application in order to support my Astro-photography
habit without having to stoop to Windows. I already have code to
align and stack images, so mostly I'm looking for a tool that can
carry this software as a plugin. I'd also provide FITS plugins.

I've rejected gimp because of its weak (non-existent) support for
high bit depths. Images from astronomy cameras is typically 16bits,
and after stacking can be higher. So I need support for at least
16bits per component.

Cinepaint is a possibility, but its mac port is pretty weak. I want
to natively support Mac and Linux.

Photoshop does not exist for Linux. I'd be willing to spend some
money, and I do most of my astrophoto work on mac, but I would like
the option to run under Linux. Oh well.

So Krita survives the major cuts in my mind. (I'm having trouble
getting kde4 and koffice2 compiled for my Mac, but I believe it
is doable.) But is this really a reasonable thing for me to want
to do with Krita? Here is some more detail:

The images I work with are RGB48 from a Nikon D80 camera, so they
are fairly large. Then I will want to build up a stack of them,
typically a half dozen or dozen images, and also combine a few
dark field shots. The processing would amount to aligning each
image, adding them to a stack, subtracting out the dark-field
images, then tone-mapping the results.

I have been thinking along the lines of importing the images into
an image stack layer group, and the dark fields into another layer
group. Within each layer group, it would be nice to be able to turn
individual frames on/off.

So does this all sound doable in Krita? I expect to write plugins
to do stacking and dark field correction. (And of source I/O of
FITS files.)

- --
Steve Williams "The woods are lovely, dark and deep.
steve at icarus.com But I have promises to keep,
http://www.icarus.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
JL VT
2010-08-30 00:42:37 UTC
Permalink
Hello Stephen!.

My knowledge of Krita's insides is still limited, but I'll try to let
you know of all things I believe or am certain that can be done in
Krita.

On Sun, Aug 29, 2010 at 7:03 PM, Stephen Williams
-----BEGIN PGP SIGNED MESSAGE-----
[...] skipped text [...]
So Krita survives the major cuts in my mind. (I'm having trouble
getting kde4 and koffice2 compiled for my Mac, but I believe it
is doable.) But is this really a reasonable thing for me to want
A Mac user interesting in Krita!, This is great news :)
The images I work with are RGB48 from a Nikon D80 camera, so they
are fairly large. Then I will want to build up a stack of them,
typically a half dozen or dozen images, and also combine a few
dark field shots. The processing would amount to aligning each
image, adding them to a stack, subtracting out the dark-field
images, then tone-mapping the results.
Aligning -> I haven't done this before, but aligning an image with
another based on their limits sounds very doable and simple. Even if
it wasn't supported (I doubt it) it could be done hackishly by
blitting a layer into another that's correctly aligned.
Adding them to a stack -> KisImage, the class that controls images in
Krita, is a stack, so this is doable and should be simple.
Subtracting out the dark-field images -> Perfectly doable, there are
composite operations for that.
Tone-mapping -> This is the complex part isn't it?. I've seen mentions
of High Dynamic Range in Krita's source code, but I'm not sure if the
feature is finished. I'll let someone with more knowledge respond.
I have been thinking along the lines of importing the images into
an image stack layer group, and the dark fields into another layer
group. Within each layer group, it would be nice to be able to turn
individual frames on/off.
KisImage supports turning individual frames on and off from
visibility, I think it should be simple to disable them from being
composited and tone mapped, but I'm not sure. Nevertheless, it's
probably doable.
Also, making 2 image stacks is as simple as creating 2 KisImages.
So does this all sound doable in Krita?
This sounds doable.
I expect to write plugins
to do stacking and dark field correction. (And of source I/O of
FITS files.)
I'm not sure exactly which category your plugin fits, if it is a
filter or something else. But there's a broader plugin category called
"extensions" for those that include several subplugins.
Moreover, anything that could be described as a filter will be simple
to do, as making plugins for Krita is a very straightforward task.


Thank you for your interest!.
Stephen Williams
2010-08-30 02:14:10 UTC
Permalink
Post by JL VT
A Mac user interesting in Krita!, This is great news :)
I'm interested, but it is a struggle. The fink package of kde4 seems to
be broken and I'm trying to get that worked out. So I haven't even been
able to run Krita on my mac. All my research has been done by reading
documentation, and running a 1.6 version of Krita on my openSUSE 10.3
work system.
Post by JL VT
Post by Stephen Williams
The images I work with are RGB48 from a Nikon D80 camera, so they
are fairly large. Then I will want to build up a stack of them,
typically a half dozen or dozen images, and also combine a few
dark field shots. The processing would amount to aligning each
image, adding them to a stack, subtracting out the dark-field
images, then tone-mapping the results.
Aligning -> I haven't done this before, but aligning an image with
another based on their limits sounds very doable and simple. Even if
it wasn't supported (I doubt it) it could be done hackishly by
blitting a layer into another that's correctly aligned.
I know how to do phase correlation to automatically calculate alignment,
so that is not an issue. Given one reference image, other images may
shift up/down/left/right fractions of pixels to be perfectly aligned.
I am assuming that there is some sort of remap that is possible. If
not, I can also implement the shift.
Post by JL VT
Adding them to a stack -> KisImage, the class that controls images in
Krita, is a stack, so this is doable and should be simple.
Hmm... It might work to be able to derive from KisImage to create a
stack type that is specifically for my stacking. Or is there a "stack"
class that I can derive from to make my kind of stack? Somehow I recall
from the doxygen documentation that there might be something along
those lines. Perhaps I'm thinking of the layers class?

--steve
Cyrille Berger
2010-08-30 06:40:19 UTC
Permalink
Post by Stephen Williams
Post by JL VT
A Mac user interesting in Krita!, This is great news :)
I'm interested, but it is a struggle. The fink package of kde4 seems to
be broken and I'm trying to get that worked out. So I haven't even been
able to run Krita on my mac. All my research has been done by reading
documentation, and running a 1.6 version of Krita on my openSUSE 10.3
work system.
I have been trying (weakly) with macports, I got success in compilation, but
the application crash at start-up.
Cyrille Berger
2010-08-30 06:58:08 UTC
Permalink
Hi,

First I will mention that Krita itself is aiming at being a painting
application, but we don't have objections on other people working to adapt or
write plug-ins for Krita for other purposes. We have some kind of in-progress
infrastructure to help with that situation (http://extensions.krita.org/).
Post by Stephen Williams
The images I work with are RGB48 from a Nikon D80 camera, so they
are fairly large.
The question is how large should be the result, I often do 4000x2000 drawings
with Krita, with dozen of layers, so a bit more than the D80 resolution, but I
suspect that you would want a significantly larger image as a result. That
said, usually the bottleneck is memory, since you are ready to invest some
money, I guess, investing in memory might not be a problem ;) Otherwise if the
resulting image is really too big, an alternative would be to use VIPS [1],
which is a library design for processing of very large image.
Post by Stephen Williams
Then I will want to build up a stack of them,
typically a half dozen or dozen images, and also combine a few
dark field shots. The processing would amount to aligning each
image, adding them to a stack, subtracting out the dark-field
images, then tone-mapping the results.
There is already a tone mapping plugin, but currently it is implemented
separately of the filter API, as a special color conversion plugin. But it
would be possible to make it a filter and then use it as a filter layer/mask.
For the combination itself, right now it is implemented as a "cascade", layers
are combined two-by-two, so if you have four layers in a group: "layer1",
"layer2", "layer3" and "layer4", then first "layer1" is combined with "layer2"
to give "layer12" which is combined with "layer3" to give "layer123" which is
combined with "layer4" to give the result on the screen. I suspect that for
your use case, you would need to write an algorithm that is combining all four
layers at the same time. If this is the case, the good thing is that it is
actually a todo of mine (for a future release, and I would not mind anyone
else implementing that for me ;) ) to make it possible to replace the
combination algorithm of a group.
Post by Stephen Williams
I have been thinking along the lines of importing the images into
an image stack layer group, and the dark fields into another layer
group. Within each layer group, it would be nice to be able to turn
individual frames on/off.
That would be already doable.

[1] http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS
--
Cyrille Berger
Continue reading on narkive:
Loading...