Skip to main content

Hello everyone, 

I transformed some Orthophtos in a new coordination system and the nodata areas are black. How can I make these areas transparent? (The output data formats are TIFF and JPEG.)

(I have read the related discussions, but couldn’t find the solution for my case.)

 

Thank you for your help!

 

 

Presumably your input data are RGB24 - if this is the case what you can do is before you make your reprojection you can use a RasterInterprestationCoercer to change the interpretation from RGB24 to RGBA32.

This will add in an ALPHA band which is what controls the transparency - The ALPHA channel is similar to NoData, however, it’s subtly different in that is allows for various levels of transparency.

If your Raster is RGB32 going into the reprojection then the black area should also have a value of 0 in the ALPHA band. The RGB will still show 0,0,0 for pixel values.

You will need to be careful with your output format though and make sure it supports the ALPHA band. JPEG for example does not support it but PNG does. 

In summary try the following

Reader>RasterInterpretatoinCoercer>Reprojector>Writer (PNG or TIFF)

 


Thanks for your reply. It worked.

The problem is now with the world file. I need to choose the format .jgw while exporting the orthophotos as .png. How can I solve it?


Another question is for .tiff input files. How I can remove the black areas of this file format?

 

Thank you!


 


Thanks for your reply. It worked.

The problem is now with the world file. I need to choose the format .jgw while exporting the orthophotos as .png. How can I solve it?


Another question is for .tiff input files. How I can remove the black areas of this file format?

 

Thank you!


 

The process is generally the same for Tiff images, however, Tiff supports a lot more band types than just RGB. 

For non-RGB data typically you would use NoData - if a Tiff dataset has a noData defined for a specific Band then FME will honour the NoData value when reprojecting or Clipping.

If, however, your input Tiff already has the black area in the data then it becomes a little more tricky. Not impossible, but tricky. Is this the case that you have? Are you able to get the original data back at all?

 


Hello and thanks for your reply.

Actually, I have the problem with world file format with PNG. I would appreciate your help with it to.

 

About your question: The original TIFF file is a rectangular orthophoto which does not have any black bands. But of course, it has black points inside the photo.

Is there any solution for it?


Hello and thanks for your reply.

Actually, I have the problem with world file format with PNG. I would appreciate your help with it to.

 

About your question: The original TIFF file is a rectangular orthophoto which does not have any black bands. But of course, it has black points inside the photo.

Is there any solution for it?

Hmm, Are you referring to the content of the file or simply the file name? You might be able to rename the file from .wld to .jgw. Do you have a lot of files to convert?
 


It is simply the file name, but I can’t and I won’t do it manually. I want to share the FME Flow link with some people who are not expert in FME and I do not want to ask them to rename the file.


It is simply the file name, but I can’t and I won’t do it manually. I want to share the FME Flow link with some people who are not expert in FME and I do not want to ask them to rename the file.

In that case I would probably use a FeatureWriter to output the png file(s) and then use a FileCopy writer to rename the output file following it’s creation. The FileCopy writer can be used to either copy or move files. I guess I’d probably keep the .wld file and also make a .jgw file as a copy of it. 

Something like this maybe:

 


Reply