Skip to main content
Solved

Thrim white borders of a tiff

  • April 28, 2016
  • 2 replies
  • 71 views

Forum|alt.badge.img

Hi, I have some large 1 bit single band tiffs and I want trim the empty white space from each edge of the image.

Maybe 25 pixels from the 1st black pixel found on each border if possible.

I think I need to determine the 1st black pixel from the border on each side then use this info to create a polygon to clip the image.

I just have no idea how to work out the area I want to clip within the workbench, not much of a raster expert.

Best answer by jdh

Assuming your borders are not regular:

 

Set the white pixel to NoData

 

Use the RasterExtentsCoercer in DataExtents mode

 

HullAccumlator to get a single output polygon with no holes

Buffererer (-1*#pixels*pixel_size)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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.

2 replies

jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • Best Answer
  • April 28, 2016

Assuming your borders are not regular:

 

Set the white pixel to NoData

 

Use the RasterExtentsCoercer in DataExtents mode

 

HullAccumlator to get a single output polygon with no holes

Buffererer (-1*#pixels*pixel_size)


Forum|alt.badge.img
  • Author
  • April 29, 2016

Assuming your borders are not regular:

 

Set the white pixel to NoData

 

Use the RasterExtentsCoercer in DataExtents mode

 

HullAccumlator to get a single output polygon with no holes

Buffererer (-1*#pixels*pixel_size)

geat thanks, I do want regular borders so have adjusted the RaterExtentsCoercer to use DataMBRExtents.

Some twueking to do but looks like I can achieve what I want with these transformers, thanks for the help.