[gdal-dev] Using Python gdalwarp to read gif file and world file, re-project to another picture

Guodong Zhu gd.zhu at outlook.com
Sat Mar 7 15:27:12 PST 2020


Hi Sean,

The background is actually not transparent : ) Just for your reference, I followed the following post and removed the background:
https://stackoverflow.com/questions/765736/using-pil-to-make-all-white-pixels-transparent

Thanks for your help on my question!

Best regards,
Guodong
From: gdal-dev <gdal-dev-bounces at lists.osgeo.org> On Behalf Of Sean Gillies
Sent: Friday, March 6, 2020 1:22 PM
To: gdal dev <gdal-dev at lists.osgeo.org>
Subject: Re: [gdal-dev] Using Python gdalwarp to read gif file and world file, re-project to another picture

Hi Guodong,

On Thu, Mar 5, 2020 at 2:16 PM Guodong Zhu <gd.zhu at outlook.com<mailto:gd.zhu at outlook.com>> wrote:
Hi Sean,

Thanks a lot for your answer! It works for me. I have one follow up question: is there a way to make the background transparent instead of being white?

I really appreciate your help!

The background is transparent, I think it may appear white due to details of your image viewer. If you convert the warped GeoTIFF to a PNG like

gdal_translate -of PNG warped.tif warped.png

you'll have a file that looks properly transparent in a browser or image viewer.

--
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200307/a871d6b4/attachment.html>


More information about the gdal-dev mailing list