Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

Autres versions - même langue

Version: 333913 (ubuntu - 24/10/10)

Section: 1 (Commandes utilisateur)


nearblack - .TH "nearblack" 1 "Wed Sep 29 2010" "GDAL"


nearblack - convert nearly black/white borders to black


 nearblack [-white] [-near dist] [-nb non_black_pixels]
           [-o outfile] infile


This utility will scan an image and try to set all pixels that are nearly black (or nearly white) around the collar to exactly black (or white). This is often used to 'fix up' lossy compressed airphotos so that color pixels can be treated as transparent when mosaicing.

-o outfile:
The name of the output file to be created. Newly created files are currently always created with the HFA driver (Erdas Imagine - .img)
Search for nearly white (255) pixels instead of nearly black pixels.
-near dist:
Select how far from black (or white) the pixel values can be and still considered near black (white). Defaults to 15.
-nb non_black_pixels:
number of non-black pixels that can be encountered before the giving up search inwards. Defaults to 2.
The input file. Any GDAL supported format, any number of bands, normally 8bit Byte bands.

The algorithm processes the image one scanline at a time. A scan 'in' is done from either end setting pixels to black (white) until at least 'non_black_pixels' pixels that are more than 'dist' gray levels away from black (white) have been encountered at which point the scan stops. The nearly black (white) pixels are set to black (white).

Note that this algorithm is only applied to horizontal scanlines, so a photo with an indentation in the top or bottom will not have that indentation identified. The processing is all done in 8bit (Bytes).

If the output file is omitted, the processed results will be written back to the input file - which must support update.


Frank Warmerdam <>

(20:17:33) Ploop: Tu peut m'expliquer comment fonctionne l'IA?
(20:17:34) Jayce: non, c'est trop long
(20:17:35) Jayce: en plus il faut avoir une grande largeur/vue d'esprit
(20:17:36) Jayce: et connaitre un peu le fonctionnement du cerveau
humain sous forme mathématique
-- Jayce - Une autre fois, peut-être, petit scarabé --