Skip to main content
Solved

setting default color while reprojecting tiff file

  • December 3, 2014
  • 7 replies
  • 10 views

zzupljanin
Contributor
Forum|alt.badge.img+4
Hi,

 

 

when I reproject a tiff file it sets as black those areas that incure due to rotation of original file. Is there a way to set them in other color. Of course, using raster cell replacer you can. But that will change all black colors in photo which I'd like to preserve since they were there in original file.

 

 

Best answer by borone

Try the following:

 

1. for each channel if (DN = 0) than DN = DN +1

 

2. set no data value to 0

 

3. reproject your image

 

 

Borone 
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

takashi
Influencer
  • December 3, 2014
Hi,

 

 

Cells in the outside area seem to be set to Nodata (0 by default).

 

How about setting Nodata value to a preferable color with the RasterBandNodataSetter before the reprojection?

 

 

Takashi

zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • December 3, 2014
Thank you for the idea. Yeah, you could use that solution (with Pallete or BandRemover), but you need to be sure to pick the color that doesn't appear inside of photo (and I have about 10 000 photos with various content). The point is to only change color outside of reprojected area.

  • December 3, 2014
Hello,

 

FME create nodata value and it is appear in black.If you use RasterBandNodataSetter and write 255, this area will be in write and you won't see it if your found is white too.

takashi
Influencer
  • December 3, 2014
hmm... the RasterBandNodataRemover can't be used to show the color, after reprojection? or use again the RasterBandNodaSetter to reset Nodata value.

zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • December 3, 2014
@jydee

 

 

that is the point. I'm certain there is 255 color inside of picture that I don't want to define as no data. I need to mark only those on outside of photo.

 

 

@Takashi

 

I'm not sure i follow. I used RasterBandRemover or RasterPalette Remover to reset all colors on photo, and then RasterBandNodataSetter followed by reprojection. But I still need to define color that I don't have inside of photo (in RasterBandNodataSetter transformer) so that only outside area is marked as null.

 

 

takashi
Influencer
  • December 3, 2014
I don't think you need to remove bands and palettes.

 

The RasterBandNodataSetter/Remover do not change cell values; they set/remove Nodata value definition of the raster feature.

 

My idea is:

 

read the raster

 

-> RasterBandNodataSetter (set or change Nodata definition to preferable color for outside area)

 

-> reprojection (value of outside cells will be set to Nodata)

 

-> RasterBandNodataRemover (remove Nodata definition) or RasterBandNodataSetter (reset Nodata definition)

Forum|alt.badge.img
  • Best Answer
  • December 3, 2014
Try the following:

 

1. for each channel if (DN = 0) than DN = DN +1

 

2. set no data value to 0

 

3. reproject your image

 

 

Borone 

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings