Hexagon Geospatial
MENU

Smart M.App

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Valued Contributor
Posts: 517
Registered: ‎10-27-2015
Accepted Solution

Pixel Transparency/Opacity Management

Hello everybody,

I built a SMART M.APP using an analytical recipe. The last operator is a Raster Ouput, that create a u1 thematic raster. When I test it, the output is correct but I can't manage the pixel transparency. 

The color table is like this:
0 - dark

1 - red

 

I would like to see only red pixels.

In the raster Ouput operato I set NoData Value = Integer(0)

 

In ERDAS IMAGINE I did it changing manually the Opacity value in the raster attribute table or, for the preview, using raster to bitmap operator.

Thank you

Highlighted
Staff
Posts: 119
Registered: ‎07-04-2016

Re: Pixel Transparency/Opacity Management

Dear Giuseppe,

 

There are two possible options how you can do it:

 

1. First one is adding the Opacity column to the raster through Create Column(s) operator with following parameters: Attrbute Name - OpacityTable Type - Float and Custom Table Input operator as Attribute Value.

 

2016-10-03 10_16_36-Untitled_1 - ERDAS IMAGINE 2016.png

 

In a Custom Table Input you should specify the size (if 8 bit image, so 256 rows), where the first row will have vallue of 0. 

 

2016-10-03 10_17_40-Table Source.png

 

2. Second option seems to me more flexible. 

 

2016-10-03 10_20_35-Untitled_1 - ERDAS IMAGINE 2016.png

 

The same idea here, just in Custom Table Input is enough to specify two rows with two values:

 

2016-10-03 10_23_14-Table Source.png

 

So not important what is the Pixel Type of your image, the first row will have Opacity of 0.

 

 

Kind Regards,

Marina Vardovska

 

Post-Sales Engineer Remote Sensing

Hexagon Geospatial Division

 

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Valued Contributor
Posts: 517
Registered: ‎10-27-2015

Re: Pixel Transparency/Opacity Management

Thank you very much Marina!

I tried a similar solution but it creates a column named 'opacity(new)' because the attribute table of the raster has already an opacity column.
Maybe I was wrong with some operators, I will with your models.

Regards

Staff
Posts: 119
Registered: ‎07-04-2016

Re: Pixel Transparency/Opacity Management

Dear Giuseppe,

 

It creates new Opacity column, when you specify Table Type as Integer.

While it should be Float.

 

Kind Regards,

Marina

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Valued Contributor
Posts: 517
Registered: ‎10-27-2015

Re: Pixel Transparency/Opacity Management

Marina, 

I tried different ways.  Now it works:

Spatial_Modeler.JPG

The 0,1 Float Table for the Opacity is the one one the right. The first on the left is for colors.
Thank you for your help!!!

Regards

Valued Contributor
Posts: 517
Registered: ‎10-27-2015

Re: Pixel Transparency/Opacity Management

Dear all,

How can I manage the opacity of a raster with many bands? For example a three layer stack from a Sentinel 2 image (16 bit img format)? 

thank you!

Staff
Posts: 119
Registered: ‎07-04-2016

Re: Pixel Transparency/Opacity Management

Hello Giuseppe,

 

Not sure if that is what you are looking for. If not, please clarify more your question.

 

You can set the value needed to be NoData, therefore transparent, with the help of Set to NoData operator. For this you should carefully read the following article http://community.hexagongeospatial.com/t5/Spatial-Recipes/Handling-NoData-in-Spatial-Modeler/ta-p/95... as well as the comment from Ian below it. 

 

If you need to set the range of values to be NoData, so you can do it with Either/Or operator by setting some range to have 0 value. Then specify 0 as NoData in Raster Output operator.

 

2017-10-17 10_50_53-Untitled_1 - ERDAS IMAGINE 2016.png

 

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.