With only using GDAL command line tools is it possible to avoid those white borders around edges of features?

I am using gdal_translate to convert vector PDF to raster mbtiles (OGR is not recognizing PDF format but GDAL does)

gdal_translate -of mbtiles --config GDAL_PDF_DPI 300 test.pdf test.mbtiles
gdalbuildvrt -srcnodata 255 output.vrt test.mbtiles

(I am using first gdal_translate with some -gcp points to georeference nonspatial-pdf but I have removed it here for easy reading)

I am getting this result:

not correct

but this is what I want:


  • 1
    You could convert the pdf first to png or tiff, move the background to alpha with e.g. GIMPs color to alpha tool, then georeferencing. I have not found an easy solution with imagemagick to automate it ... Maybe this will work. – pLumo Mar 8 '18 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.