EnglishFrenchSpanish

OnWorks favicon

nearblack - Online in the Cloud

Run nearblack in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command nearblack that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


nearblack - nearblack convert nearly black/white borders to black

SYNOPSIS


nearblack [-of format] [-white | [-color c1,c2,c3...cn]*] [-near dist] [-nb non_black_pixels]
[-setalpha] [-setmask] [-o outfile] [-q] [-co "NAME=VALUE"]* infile

DESCRIPTION


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

-o outfile:
The name of the output file to be created. Newly created files are created with the
HFA driver by default (Erdas Imagine - .img)

-of format:
(GDAL 1.8.0 or later) Select the output format. Use the short format name (GTiff for
GeoTIFF for examle).

-co 'NAME=VALUE':
(GDAL 1.8.0 or later) Passes a creation option to the output format driver. Multiple
-co options may be listed. See format specific documentation for legal creation
options for each format. Only valid when creating a new file

-white:
Search for nearly white (255) pixels instead of nearly black pixels.

-color c1,c2,c3...cn:
(GDAL >= 1.9.0) Search for pixels near the specified color. May be specified multiple
times. When -color is specified, the pixels that are considered as the collar are set
to 0.

-near dist:
Select how far from black, white or custom colors the pixel values can be and still
considered near black, white or custom color. 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.

-setalpha:
(GDAL 1.8.0 or later) Adds an alpha band if the output file is specified and the input
file has 3 bands, or sets the alpha band of the output file if it is specified and the
input file has 4 bands, or sets the alpha band of the input file if it has 4 bands and
no output file is specified. The alpha band is set to 0 in the image collar and to 255
elsewhere.

-setmask:
(GDAL 1.8.0 or later) Adds a mask band to the output file, or adds a mask band to the
input file if it does not already have one and no output file is specified. The mask
band is set to 0 in the image collar and to 255 elsewhere.

-q:
(GDAL 1.8.0 or later) Suppress progress monitor and other non-error output.

infile:
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 or white until at least 'non_black_pixels' pixels that are
more than 'dist' gray levels away from black, white or custom colors have been encountered
at which point the scan stops. The nearly black, white or custom color pixels are set to
black or white. The algorithm also scans from top to bottom and from bottom to top to
identify indentations in the top or bottom.

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.

AUTHORS


Frank Warmerdam warmerdam@pobox.com

Use nearblack online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Phaser
    Phaser
    Phaser is a fast, free, and fun open
    source HTML5 game framework that offers
    WebGL and Canvas rendering across
    desktop and mobile web browsers. Games
    can be co...
    Download Phaser
  • 2
    VASSAL Engine
    VASSAL Engine
    VASSAL is a game engine for creating
    electronic versions of traditional board
    and card games. It provides support for
    game piece rendering and interaction,
    and...
    Download VASSAL Engine
  • 3
    OpenPDF - Fork of iText
    OpenPDF - Fork of iText
    OpenPDF is a Java library for creating
    and editing PDF files with a LGPL and
    MPL open source license. OpenPDF is the
    LGPL/MPL open source successor of iText,
    a...
    Download OpenPDF - Fork of iText
  • 4
    SAGA GIS
    SAGA GIS
    SAGA - System for Automated
    Geoscientific Analyses - is a Geographic
    Information System (GIS) software with
    immense capabilities for geodata
    processing and ana...
    Download SAGA GIS
  • 5
    Toolbox for Java/JTOpen
    Toolbox for Java/JTOpen
    The IBM Toolbox for Java / JTOpen is a
    library of Java classes supporting the
    client/server and internet programming
    models to a system running OS/400,
    i5/OS, o...
    Download Toolbox for Java/JTOpen
  • 6
    D3.js
    D3.js
    D3.js (or D3 for Data-Driven Documents)
    is a JavaScript library that allows you
    to produce dynamic, interactive data
    visualizations in web browsers. With D3
    you...
    Download D3.js
  • More »

Linux commands

Ad