Hi Lukas,

Lukáš Jirkovský wrote:
> Hi,
> 
> while working on my GSoC project I've noticed that current OpenEXR
> implementation has only 4 bands. This makes it's usage inconvenient
> sometimes because it makes everyone to use ImportImageAlpha even when
> alpha is not necessary. It seems that OpenEXR is almost exclusively
> used with RGBA but when someone doesn't need alpha it should be
> allowed to use it with assumption that all pixels are opaque.

Actually, its not that simple, as the alpha is usually pre-multiplied:
value_in_file = value * alpha. This makes alpha blending in computer 
graphics applications faster. Hugin doesn't use anything of that though 
(only 0 and 1 alpha...), but a general solution needs to take care of that.

The best solution would be to write a RGBA -> RGB vigra accessor that 
could be passed to import image and would convert the RGBA -> RGB.

the importImageAlpha() functionality is also a hugin/enblend only 
feature, I haven't submitted that to the main vigra branch last time I 
sent my changes there. However, that is not really a problem, as its 
just an extension and could easily be moved into our own vigra_ext lib.

> I'd like to try to implement this. My question is: Is it acceptable or
> not? I mean when OpenEXR is stored as RGBA is it against some
> non-written rules in VIGRA to allow loading/storing with using only
> RGB values?

Vigra is a multi purpose lib, and not restricted to a specific number of 
channels. For example, many remote sensing satellites have blue, green, 
red and infrared channels (The infrared channel contains valuable 
information about vegetation).
Vigra is pretty dumb when it comes to image import/export, as it doesn't 
have a proper handling for alpha channels. I have added the 
ImageInfo::getExtraSamples() (or something similar), so that it is at 
least possible to differentiate between "real" channels and mask or 
alpha channels.

 > I don't want to block it's way into upstream only because
> of this. If you want to hear my opinion I don't see any problem here
> because eg. tiff allows using from 1 to 4 bands.

I don't think that this will be a problem, as the vigra import/export is 
quite bare bones anyway.

One also needs to submit test cases for the new functionality, otherwise 
it won't be accepted by the vigra maintainers.

ciao
   Pablo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx
-~----------~----~----~----~------~----~------~--~---

Reply via email to