Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
54 views

Export GTiff to PNG

I'm trying to export a raster as a PNG file only for visualization purposes. Currently, gdalinfo -stats shows this: Driver: GTiff/GeoTIFF Files: ./downloads/2023-06-01.tiff Size is 764, 693 Coordinate ...
Guillermo Moreno Castaño's user avatar
0 votes
0 answers
105 views

Opening .png.aux.xml file in QGIS

I received a .png.aux.xml file. I have tried to read it with the GDAL translator and by making a URL from the code. I haven't been able to open the file in QGIS. Any ideas?
Pedro Castro Gomez's user avatar
0 votes
1 answer
86 views

The PNG image I created using GDAL's createcopy method looks 48-bit on Windows

I use GDAL ceatecopy() method to convert a 16bit TIF file to a PNG file. Why the PNG file generated is 48bit? But I can successfully display it on ArcGIS. Thumbnails on Windows are black.
keweizhou's user avatar
1 vote
2 answers
435 views

Read a PNG and JPEG image with world file in Java

I have a program where given an image I want to read the coordinates for each pixel. I have implemented the code if the given image is a TIFF image and it works fine. The code that gives me the object ...
Rute's user avatar
  • 51
0 votes
1 answer
890 views

Georeferencing PNG from bounding box in GDAL?

I have an image in PNG format and bounding box coordinates (upper left, lower right). How do I georeference it using command-line interface tools such as GDAL (or Python if it is not possible)? In the ...
sutan's user avatar
  • 969
2 votes
2 answers
2k views

Converting PNG to GeoTIFF using GDAL Python

I want to ask how to convert PNG to GeoTIFF using GDAL in Python. I ran this code but it's not work and I want to export the output into my computer. How can I fix my code? ds = gdal.Open('input.png') ...
ghea ayunda's user avatar
1 vote
2 answers
1k views

GTiff to PNG conversion- Gdal Python

I am trying to convert a Gtiff image to PNG using Gdal in python with gdal_translate. My gtiff has the following properties: Width 255 Height 255 Data type Float32 - Thirty two bit floating point ...
Karantai's user avatar
2 votes
0 answers
369 views

Convert a one-band GTIFF to PNG with adjusted color ramp using GDAL

I have a one-band fCover GTiff with values ranging between 0 to 0.4 and I would like to convert it to a png using a color ramp adapted to this tiff. I already have a png from this tif but the color ...
Camille C's user avatar
1 vote
1 answer
300 views

Reading from PNG file in Java from using GDAL

I've used gdalwarp.exe to project a tif-file from EPSG:4326 to EPSG:32635 and storing it in the PNG-format: gdalwarp.exe -dstalpha -t_srs EPSG:32635 -s_srs EPSG:4326 -if GTiff -of PNG -et 0.125 -r ...
Paul's user avatar
  • 475
2 votes
1 answer
1k views

gdal_translate problem translating 16bit PNGs

I am trying to use the SRTM earth images to convert them into heightmaps for 3D application. I can output a 8-bit PNG like this: gdal_translate -ot Byte -scale -of PNG srtm_44_05.tif heightmap.png ...
KaiserJohaan's user avatar
4 votes
1 answer
2k views

Merge *.png files into one using GDAL

I built a Python script that downloads tiles from some map service. This service cannot be imported to QGIS as a tile layer so I decided to download tiles directly using requests module. The script ...
Pavel Pereverzev's user avatar
2 votes
0 answers
3k views

Create GeoTIFF from PNG raster with PGW world file with GDAL

I've used GDAL tools for several other operations on GeoTIFFs. There is lots of information on how to splice GeoTIFFs into PGW world files and images, but I haven't found ANY documentation on how to ...
Andreas's user avatar
  • 51
4 votes
1 answer
378 views

Add PNG as a layer in Mapnik

I'm playing around with Mapnik and trying to add a PNG image over a map created from an XML file. This is my XML file: <Map background-color="white" minimum-version="0.7.2" srs="+init=epsg:3395"&...
Phu Nguyen's user avatar
1 vote
1 answer
621 views

Alpha-channel PNG from gdaldem

I was hoping that the following command would give me an alpha-channel PNG which was transparent where the DEM has "nodata": gdaldem color-relief -alpha -of png dem.tif palette.dat out.png I get an ...
Ture Pålsson's user avatar
2 votes
0 answers
2k views

Export PostGIS geom polygon to PNG

I am trying to build a REST API using Flask and Postgis. I have a PostGIS table with a GEOM column. Querying the table using ST_AsGeoJSON gives me a MULTIPOLYGON with lat, lon in WGS84. [('...
Hrafn Malmquist's user avatar
0 votes
1 answer
868 views

convert png with alpha channel to GeoTiff

How do I convert a png with an alpha channel to a GeoTIFF using gdal_translate so that the alpha channel gets reflected in the GeoTiff. Currently the GTiff that is produced is resulting in 3 Bands, ...
vaibhav 's user avatar
4 votes
1 answer
5k views

Performing gdal translate to png/jpeg?

I tried gdal translate to png: gdal_translate image.bsq image.jpg -of JPEG -outsize 10% 10% -scale and jpeg: gdal_translate image.bsq image.png -of PNG -outsize 10% 10% -scale jpeg looks better ...
KcFnMi's user avatar
  • 563
0 votes
1 answer
1k views

gdal translate -co, which options are available to PNG?

I can create a PNG with: gdal_translate -of PNG -outsize 10% 10% image.bsq image.png I see there is a -co (creation options) parameter I can pass to gdal translate. Where can I find which options ...
KcFnMi's user avatar
  • 563
2 votes
2 answers
3k views

Convert TIF to PNG without normalizing alpha

I'm trying to make some height maps with elevation data from https://earthexplorer.usgs.gov/. Since they give you assets in separate TIF tiles, I need to convert them to PNG and stitch them together ...
Sjael's user avatar
  • 33
1 vote
3 answers
13k views

Translating GeoTIFF to 16-bit PNG with GDAL

I have a GeoTIFF file which displays the following information when running gdalinfo: Band 1 Block=10012x1 Type=Float32, ColorInterp=Gray Description = Layer_1 Min=1638.991 Max=2577.040 Minimum=...
Mark Riddell's user avatar
1 vote
1 answer
432 views

Wrong dimensons on .png-file when using gdal_translate

I am using gdal_translate -of PNG -ot UInt16 -scale MIN MAX 0 65535 "source.tiff" "output.png" in the command-prompt to create a .png-file from a .tif-file that I created using the Interpolation-...
Gisnoob123's user avatar
2 votes
1 answer
4k views

error "pointer hDs is NULL in GDAL GetProjectionRef" when using gdal_rasterize [duplicate]

I want to convert a .shp to .tif. So I find the tool gdal_rasterize may help. But when I input the file it always meet this error: pointer hDs is NULL in GDAL GetProjectionRef I have tried different ...
user83388's user avatar
3 votes
0 answers
5k views

create image out of geojson (gdal_rasterize?)

Short version: I need to know how I can convert a .geojson-file to an according .png-file (or any other image format) long version: I have a .geojson which was created by gdal_polygonize from a .png ....
Selphiron's user avatar
  • 775
2 votes
1 answer
1k views

Burning shapefile geometry to raster in PNG format with gdal_rasterize?

I was trying to overlay a shapefile to some raster images from a directory using gdal_rasterize. But then encountered this error: ERROR 6: The PNG driver does not support update access to existing ...
lovelyvm's user avatar
  • 517
0 votes
1 answer
445 views

eliminate small polygons of a PNG with gdal_sieve

I want to eliminate polygons wich consist of less than 3550 px in this PNG . I tried using gdal_sieve but there seems to be an error. gdal_sieve -st 3550 E8.png -of PNG E8sieve3550_4.png ERROR 6: ...
Selphiron's user avatar
  • 775
0 votes
1 answer
252 views

gdal_polygonize unable to open PNG

I use OSGeo4W on Windows 7 (64 bit) and included libpng16.dll When I try C:\OSGeo4W64\bin>gdal_polygonize star.png bla I get the following error: ERROR 4: `star.png' does not exist in the file ...
Selphiron's user avatar
  • 775
1 vote
0 answers
173 views

Extract polygons of PNG with GdalOgrInJava

I have PNG pictures with polygons of different colours on them. What I plan to do is to extract these Polygons using the polygonize function (see here) Then I will try to encode the polygons in ...
Selphiron's user avatar
  • 775
8 votes
2 answers
13k views

Convert PNG to GeoTiff using GDAL

I have a map portion PNG and its associated PRJ file. I want to convert the PNG to a GeoTIFF. I know how to convert a PNG to a GeoTiff if the bounding box is available: gdal_translate -of Gtiff -...
Kartins's user avatar
  • 283
2 votes
1 answer
6k views

How can I correct a .pgw file for a PNG image?

I have a PNG file and I need its .pgw file to be set with NAD 83 as the projection. I have created a .pgw file: 799 0 0 -799 -122.562 37.1946 However when I open the PNG in QGIS or ArcMap 10.2 it ...
cbunn's user avatar
  • 1,447
3 votes
1 answer
5k views

Generating JPEG tiles using gdal2tiles.py?

I am using gdal2tiles.py to generate tiles and packing it into MBTiles using mb-util. gdal2tiles by default generates PNG tiles. When I convert PNG tiles to JPEG large black area around tiles are left ...
user1667302's user avatar
5 votes
1 answer
4k views

GeoTiff convert to PNG with transparency?

I need to convert a GeoTIFF image to PNG format with "NoData" pixels in the original image being transparent in the output. Is there any tool particularly in ArcGIS ArcToolbox or GDAL for this ...
alextc's user avatar
  • 2,023
4 votes
2 answers
2k views

ImageMagick's convert program changes PNG file format so that color/alpha info doesn't survive GDAL

It appears that ImageMagick's convert program changes something in my PNG file that causes GDAL processing to mess up the color and/or transparency bands. My original PNG file gets processed ...
Jeffo's user avatar
  • 83