Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a MODIS ariel image geotiff and I want to remove black nodata pixel (this is Aerosol Of Thickness) 1 band image.

I've done like this C:>convert -transparent black MOD04.A2003226.0325.006.2013074065606.tif output1.tif

and the output1.tif is large x20 times input MODIS tif file. But it is blacker than input, no transparent black color.

Some one can help me? Please!

This is input sample (i need remove all black nodata point) Input image

And this is output converted (it's worse)

output image

share|improve this question
Please check -> Raster map reprojection (warping) maintaining NULL values (sea etc) – markusN May 11 '13 at 6:28
thank you first, but could you tell me that my image is nodata (black) or null data or it is really low data (still have data but not much), please? (I'm new vidth GDAL and MODIS Photo). – Bằng Rikimaru May 12 '13 at 8:12

Did you check that the "black" pixels are really black? They might have a low value and appear black on the screen, thus your conversion will not consider them black.

share|improve this answer
my supervisor tell me that because cloud so the image is black. But if it is really low value then could you tell me how to make it transparent ("black" background), please? – Bằng Rikimaru May 12 '13 at 8:10
You may open the data in a GIS (e.g. QGIS from and query the map. This is helpful to understand if the pixel values are as expected or if an unfortunate color table is tricking you... – markusN May 12 '13 at 9:09
use gdalinfo -hist input_file_name to generate a histogram of your data. Using the sample you provide, the first 8 buckets of the histogram are 434015 38988 28254 17006 8946 3909 1518 575. Looking at the full histogram indicates there is indeed a lot of true black, but about 20% of what looks like true black is near-black. (Note - the file you posted is a jpg, which due to lossy compression may be introducing near-blacks where they don't occur in the original (or obscuring near-blacks where they should be). – Llaves Jul 1 '13 at 4:35

If you have pixels that aren't actually black you can use GDAL's nearblack:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.