Skip to main content
Question

Reducing bit depth in TIF images


mappymatty
Contributor
Forum|alt.badge.img+3
Is there a way to reduce the bit depth in TIF images from 24 to 8?

 

 

I've gad a look at the RasterInterpretationCoercer and RasterNandInterpretationCoercer transformers but haven't managed to get very far.

 

 

The ultimate destination is BIX BCP and this is only compatible with 8 bit colour hence the requirement to reduce the bit depth.

 

 

Thanks,

 

 

Matt

5 replies

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • May 21, 2014
Hi,

 

 

The RasterInterpretationCoercer is what you need, if your goal is a 3 band 8 bit raster select RGB24 as interpretation type.

mappymatty
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • May 27, 2014
Hi Itay,

 

Thanks for your response. Will a RGB24 not gice be 8 bits per band so a total of 24?

 

I need to have a bit depth of 8 bits in total not 8 bits per band. Do you know whether there's a way to achieve this?

 

Thanks,

 

Matt

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 2, 2014
If u want a single band of 8 bit u must remove the (selected)rasterband(s).

 

U can use a rasterselector and then a rasterbandremover.

 

 

 

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 2, 2014
I looked up BIX colors.

 

Thats a 5x5 coloring of wires. (8 bit color has 256 colors.)

 

So there are only 5 colors total. 25 pairs.

 

According to WIKI (hail WIKI!):

 

 

 

 

 

I think u then best want to create a colormap or a palette.

 

 

U can create a palette using rasterpalettegenerator (there is a toolset in fme to do that).

 

But you also have to make sure that all values map to just the 5 color-pair.

tim_wood
Contributor
Forum|alt.badge.img+8
  • Contributor
  • August 18, 2017

These posts may help:

https://knowledge.safe.com/questions/24156/how-to-create-256-color-raster-where-black-color-i.html

Use a RasterPaletteGenerator with a Palette Key Interpretation Type of "UInt8" and set the Maximum Number of Palette Entries to 256. On the TIFF Writer, set the Interleaving Type on the Format Parameters tab to BIP. See

http://docs.safe.com/fme/2016.0/html/FME_Desktop_Documentation/FME_ReadersWriters/geotiff/format_parameters_w.htm

(Credit to @takashi and @sander_s for these tips).

https://knowledge.safe.com/questions/50756/convert-mix-of-jpeg-and-bw-tiff-to-file-geodatabas.html

By default, the settings from the incoming Tiff data are propagated to the output through the format attributes on the source image. These attributes override the bits per cell and compression set on the output. These format attributes are designed to make TIFF to TIFF conversions simpler, but do assume that the output structure matches the input. Try adding a BulkAttributeRemover to your workspace to remove these attributes - set the Expression to Remove to "tiff_" (without the double quotes).

(Credit to David Campanas at Safe for this tip).


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