[Qgis-user] background transparency
Brett Adams
badams at spinifexgpx.com.au
Tue Aug 15 19:32:24 PDT 2017
Hi Richard,
Trialled your suggestion and others contained in the gis.stackexchange.com link. Always get the same result where if any of the three bands contain a 0, it’s removed.
Maybe I’ve got the syntax slightly wrong?
Original
gdalwarp -overwrite -s_srs EPSG:28351 ""C:/Brett.tif"
Trialled variations
gdalwarp -overwrite -srcnodata "0,0,0" -dstnodata "0,0,0" -s_srs EPSG:28351 -of GTiff "C:/Brett.tif" "C:/Brett2.tif"
gdalwarp -overwrite -srcnodata "0,0,0" -dstnodata "0,0,0" -of GTiff "C:/Brett.tif" "C:/Brett2.tif"
gdalwarp -overwrite -srcnodata None -dstnodata None -dstalpha -s_srs EPSG:28351 -of GTiff "C:/Brett.tif" "C:/Brett2.tif"
Brett
From: Richard McDonnell [mailto:richard.mcdonnell at opw.ie]
Sent: Tuesday, 15 August 2017 11:17 PM
To: Brett Adams; qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] background transparency
Hi,
Just looking into this, but you might try whats outlined here
https://gis.stackexchange.com/questions/166699/replacing-rgb-value-0-0-0-with-nodata-nodata-nodata-in-gdal
Warp, can be found under Raster, Projections, Warp fill in the fields just as you done before for the Translate, with the exception of the nodata field.
At the bottom where you see the GDAL script being constructed, you should also see a Pencil or Pen icon, select this, it will allow you to directly edit the script.
You should paste -srcnodata "0,0,0" -dstnodata "0,0,0" just after -overwrite so as you have something like below.
gdalwarp -overwrite -srcnodata "0,0,0" -dstnodata "0,0,0" -of GTiff raster_in.tif raster_out.tif
Hope this helps.
Regards,
Richard.
On 15/08/2017 13:42, Brett Adams wrote:
Richard,
Thanks for your response. Gave this a run but it’s not quite working.
Looks like the problem stems from the colour being defined across three bands, with black defined by 0,0,0
When “No data = 0” this clears all colours where band 1 = 0. Which includes a lot more colours than just black.
Tried entering a few different formats to cover the all 3 bands but the second 2 are always ignored.
Any thoughts as to how I get 3 bands recognised?
Brett
From: Qgis-user [mailto:qgis-user-bounces at lists.osgeo.org] On Behalf Of Richard McDonnell
Sent: Monday, 14 August 2017 10:16 PM
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] background transparency
Brett,
Apologies, ive just realised your version of QGIS may not have the processing toolbox.
You may also do this by going to RASTER, Conversion and selecting Translate Its the very same tool just a different interface
Regards,
Richard
On 14/08/2017 15:04, Richard McDonnell wrote:
Hi Brett
You can indeed, just use the Processing toolbox, just type Translate into the search box and select the Translate Tool under GDAL.
The values you specified as transparent, can be specified under the Nodata Value
You can also do this as part of a batch if you have a number of files, you wish to do this for.
Hope this helps,
Richard.
On 14/08/2017 14:07, Brett Adams wrote:
Hi Folks,
I have a geotiff that contains a black ground in areas where there is no data. The black background is made transparent within QGIS via “Layer Properties – Transparency”
Can I export a new Geotiff with the black background removed?
I’m running 2.6.1 On Windows-7. Yes, I know it’s an old version but I’ve had no reason to update. So far…
Thanks
Brett Adams
Spinifex-GPX
0438 861 974
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
--
Richard McDonnell
GIS Specialist PgD GIS AssocSCSI
OPW FRM Data Management
52 Stephens Green, Dublin 2.
TEL: 01 6476543
<http://www.opw.ie/>
Email Disclaimer: http://www.opw.ie/en/disclaimer/
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
--
Richard McDonnell
GIS Specialist PgD GIS AssocSCSI
OPW FRM Data Management
52 Stephens Green, Dublin 2.
TEL: 01 6476543
--
Richard McDonnell
GIS Specialist PgD GIS AssocSCSI
OPW FRM Data Management
52 Stephens Green, Dublin 2.
TEL: 01 6476543
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170816/deb5d7dc/attachment.html>
More information about the Qgis-user
mailing list