<div dir="ltr">Hi,<div><br></div><div>I'm looking for an automated/semi-automated way to remove the plain color background of some (jpeg compressed) Orthophoto RGB rasters without NoDataValue or an Alpha band.</div><div><br></div><div>Usually I get an image of some specific region with the background as a plain color (usually it's plain white or plain black but it could be also almost white or almost black or some other color, or a composition of some patches that each one is a plain color).</div><div> </div><div>The problem begins when when I want to make a mosaic. It could be hard to remove those plain regions which should be transparent - setting a single NoDataValue won't do the trick for most cases and it will also remove some data pixels.</div><div>It gets even worse if the outside was not black and then I use gdal-warp to transform the CRS and I get extra black filling on the outside.</div><div><br></div><div><div>A simple rule to classify the background pixels - a large cluster of pixels with exactly (or almost exactly) the same value - a human can tell the background instantly.</div><br class="gmail-Apple-interchange-newline"></div><div>Is there an easy way to create an alpha binary mask band to classify the background?</div><div>Afterwards, is there a tool to crop the image so I'll get a minimal frame of background?</div><div><br></div><div>Kind regards,</div><div>Idan</div></div>