I'm using GDAL to warp images into a different map-projections. However the warping processes seem to leave grey marks where the boundary of the original image was (see warped.png below). I figured out this was probably caused by my image having a white background and the 'filler' pixels created by the warping process being transparent but black. And the interpolation is smudging the black and white together (even though it shouldn't as the black is transparent).
Is there any way to avoid the grey outline from appearing? Maybe force gdalwarp to fill with opaque white rather than transparent black?
I can't do a square crop on the warped image as I'll loose bits of the image, and I can't just make my background black instead of white as this messes up some filtering I have to do beforehand.
There seems to be lots of options for gdalwarp that sound useful like -srcnodata but I can't figure out how to use them.
Answer
Using the -r near flag will implement nearest-neighbor resampling. If that doesn't get rid of the border, at least it will make it pure black!
No comments:
Post a Comment