> I need to create an ECW image with an alpha channel. The ECW SDK supplies
a
> function called NCScbmReadViewLineBGRA, which implies reading RGB data as
> well as alpha data. But I am unsure about how to create an image with such
> an alpha channel using ER Mapper or otherwise. Can anyone help me out?
>
> Cheers,
>
> Oscar ter Hofstede.
Oscar,
The ECW format supports any number of bands (channels), e.g. 1, 3, 7 or even
200 or more.
Your request is for a specialized form of image, with specific alpha channel
information.
The BGRA and other related interface calls are designed to give you a
"reasonable"
looking image, by picking reasonable band combinations based on the input
file. For example, if you try and read a 7 band landsat image,
the BGRA interface gives you the first 3 channels. The alpha channel is
always
left zero in this call. The BGRA format is often used for Windows style
bitmaps,
which is why this call is set up this way.
To do what you want, you will need to do several things:
1. When compressing, write 4 channels, as RGBA or BGRA or whatever.
2. Write your own BGRA call, using the more complex lower-level calls that
return all bands (or a selection of bands) from an image. You will
have to decide what channels are R,G,B and A in this instance.
Some notes:
a. As you are compressing as multi-channel (4 band), not RGB, you will
want to reduce your compression rate. This is because ECW takes the
special case of "RGB" compression (as differentiated from a 3 band
"multi-channel" image which it can also do), and converts the image
into YUV space, and then compresses each channel at different rates.
This is why a RGB image compresses better than a multi-channel image.
b. Other ECW plugins won't know that your 4 channel image has an alpha
channel, so will just display the first three (so you will want to
have these as RGB)
c. As an alternative to this, consider having two files, one the RGB
image, and one the alpha channel(s). This way, you can have multiple
alpha channels, and you can still use the normal RGBA call, then
do a single band call decompress the region from the 2nd ECW image,
and paste those values into the Alpha channel.
This would be a more flexible approach, and should be about as fast.
Advanced products like ER Mapper don't use the simple BGRA interface into
the library, instead they use the full multi-band interface and do their
own processing (which is why ER Mapper can for example display bands 7,4,1
from a 7 band ECW image).
Note that ECW is targetted at geospatial applications, which have the
concept of multi-channel images, not a special subset like RGBA.
Regards,
Simon
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^
Simon Cope, : e-mail:
[EMAIL PROTECTED]
Chief Software Architect : WWW:
http://www.ermapper.com
: Int'l Phone: +61 8 9388 2900
Earth Resource Mapping Pty Ltd, : Int'l Fax: +61 8 9388 2901
Level 2, 87 Colin St, West Perth. : Australia Phone: (08) 9388 2900
Western Australia 6005 : Australia Fax: (08) 9388 2901
Q: 1.2TB (1,200GB) Image over the Internet?
A: Image Web Server!
http://www.earthetc.com
-----------------------------------------------------------
To make changes to your subscription, please visit our website,
http://www.ermapper.com/technicl/ermapperl/index.htm