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'm running into an issue georeferencing a number of PNG image files. The files simply contain an image where each pixel is either transparent or a single color, forming a coverage mask. In the past, when I've georeferenced these images, the 'use 0 for transparency' checkbox masked off the transparent parts of the images and I was able to polygonize the colored parts. However, with a number of images in a recent patch QGIS will simply not mask off the transparent sections. I've opened the files with an image editor and resaved them to no effect, so it's not a formatting problem with the input png.

I can somewhat work around this by setting the value of the transparent section to the no data value, thus masking off the image in the raster layer. However, when I polygonize the raster, the no data value still gets polygonized into the .shp file.

How do I polygonize the raster and specify only the single band I want to polygonize?

share|improve this question
if this worked before, then please file a bug report at , preferably with one of these PNG images to test with. Also note the last version you remember where it still worked. – lynxlynxlynx Jul 6 '12 at 15:18
@lynxlynxlynx -- that's the odd thing, I've got some of the old png files and they /still do/ import properly, though I can't find any real difference between the files. They're both two-color PNGs, every pixel is either transparent or red. However, QGIS pulls the transparency pixels from one as the data and the red pixels from the other as the data. I updated from 1.7.3 to 1.8.0 to try to resolve it, which didn't have any effect, – Oesor Jul 6 '12 at 15:28
Still sounds like a bug or at least something the devs would like to know about. – lynxlynxlynx Jul 6 '12 at 19:37
up vote 1 down vote accepted

Issues with georeferencing aside, I can just delete the polygons once polygonized by:

  1. Toggle editing on on the layer
  2. Select all of the unwanted polygons with a search in the attribute table
  3. Delete the selected polygons
  4. Toffle off editing and save the resulting shapefile when prompted
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.