Re: [Qgis-user] Adding alpha band to raster
Personally I would create a .vrt using gdal_translate, with these "additional command line parameters": -b 1 -b 2 -b 3 -b 1 -colorinterp_4 alpha -scale_4 0 255 255 255 This assumes 8 bit RGB input, but you can adapt it for something else. It does work even before georeferencing. But depending on your workflow it might be easier just to convert to RGBA with something like imagemagick, or to open in MS Paint and save as PNG, which silently adds an alpha channel. Regards, Alister > Date: Mon, 24 Jan 2022 10:33:56 -0400 > From: Kirk Schmidt > To: qgis-user@lists.osgeo.org > Subject: Re: [Qgis-user] Adding alpha band to raster > Message-ID: <46938c47-4f37-44ac-5f96-468f29258...@nortekresources.com> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Hi Nicolas: > > I just had an idea, why not use gdal directly??? I know gdalwarp has a > -dstalpha switch to code null data Assuming this is what you want the > alpha band for) > > Kirk > > > On 1/21/2022 6:06 PM, Nicolas Cadieux wrote: > > Hi, > > > > I don't see it in the current processing algorithms. I see lot's or > > r.out... but not that one:(? I guess I could do it in Grass... > > > > Thanks for the idea! > > > > Nicolas > > > > On 2022-01-21 1:37 p.m., Kirk Schmidt wrote: > >> Hi Nicholas: > >> > >> Try r.out.gdal > >> > >> https://grass.osgeo.org/grass78/manuals/r.out.gdal.html > >> > >> Kirk Schmidt > >> > >> > >> On 1/21/2022 2:25 PM, Nicolas Cadieux wrote: > >>> Hi, > >>> > >>> What is the easiest way, in QGIS3, to add an alpha band to a > >>> raster?? Alpha bands are handy with the georeferencer. Currently, I > >>> am just adding it in GIMP before I start the georeferencer. > >>> > >>> Thanks ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Adding alpha band to raster
Thanks! I will have a look! Nicolas On 2022-01-24 9:33 a.m., Kirk Schmidt wrote: Hi Nicolas: I just had an idea, why not use gdal directly? I know gdalwarp has a -dstalpha switch to code null data Assuming this is what you want the alpha band for) Kirk On 1/21/2022 6:06 PM, Nicolas Cadieux wrote: Hi, I don't see it in the current processing algorithms. I see lot's or r.out... but not that one:( I guess I could do it in Grass... Thanks for the idea! Nicolas On 2022-01-21 1:37 p.m., Kirk Schmidt wrote: Hi Nicholas: Try r.out.gdal https://grass.osgeo.org/grass78/manuals/r.out.gdal.html Kirk Schmidt On 1/21/2022 2:25 PM, Nicolas Cadieux wrote: Hi, What is the easiest way, in QGIS3, to add an alpha band to a raster? Alpha bands are handy with the georeferencer. Currently, I am just adding it in GIMP before I start the georeferencer. Thanks -- Nicolas Cadieux https://gitlab.com/njacadieux ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Adding alpha band to raster
Hi Nicolas: I just had an idea, why not use gdal directly? I know gdalwarp has a -dstalpha switch to code null data Assuming this is what you want the alpha band for) Kirk On 1/21/2022 6:06 PM, Nicolas Cadieux wrote: Hi, I don't see it in the current processing algorithms. I see lot's or r.out... but not that one:( I guess I could do it in Grass... Thanks for the idea! Nicolas On 2022-01-21 1:37 p.m., Kirk Schmidt wrote: Hi Nicholas: Try r.out.gdal https://grass.osgeo.org/grass78/manuals/r.out.gdal.html Kirk Schmidt On 1/21/2022 2:25 PM, Nicolas Cadieux wrote: Hi, What is the easiest way, in QGIS3, to add an alpha band to a raster? Alpha bands are handy with the georeferencer. Currently, I am just adding it in GIMP before I start the georeferencer. Thanks -- Kirk Schmidt, MScF, BScF, RPF General Manager Nortek Resource Solutions Inc. 26 Church Road Sutherlands River, NS B0K 1W0 Tel (902) 922.3607 Email: k...@nortekresources.com Web: www.nortekresources.com ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Adding alpha band to raster
Hi, I don't see it in the current processing algorithms. I see lot's or r.out... but not that one:( I guess I could do it in Grass... Thanks for the idea! Nicolas On 2022-01-21 1:37 p.m., Kirk Schmidt wrote: Hi Nicholas: Try r.out.gdal https://grass.osgeo.org/grass78/manuals/r.out.gdal.html Kirk Schmidt On 1/21/2022 2:25 PM, Nicolas Cadieux wrote: Hi, What is the easiest way, in QGIS3, to add an alpha band to a raster? Alpha bands are handy with the georeferencer. Currently, I am just adding it in GIMP before I start the georeferencer. Thanks -- Nicolas Cadieux https://gitlab.com/njacadieux ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Adding alpha band to raster
Hi Nicholas: Try r.out.gdal https://grass.osgeo.org/grass78/manuals/r.out.gdal.html Kirk Schmidt On 1/21/2022 2:25 PM, Nicolas Cadieux wrote: Hi, What is the easiest way, in QGIS3, to add an alpha band to a raster? Alpha bands are handy with the georeferencer. Currently, I am just adding it in GIMP before I start the georeferencer. Thanks -- Kirk Schmidt, MScF, BScF, RPF General Manager Nortek Resource Solutions Inc. 26 Church Road Sutherlands River, NS B0K 1W0 Tel (902) 922.3607 Email: k...@nortekresources.com Web: www.nortekresources.com ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] Adding alpha band to raster
Is there anyone in this user group who provides QGIS consulting services, preferable here in Oklahoma??? Robert A. Hefner IV 3001 NW 168th Court Edmond, OK 73012 USA 405.818.5301 rhefn...@cox.net Coram Deo Confidentiality Warning: This message and any attachments are intended only for the use of the intended recipient(s), are confidential, and may be privileged. If you are not the intended recipient, you are hereby notified that any review, retransmission, conversion to hard copy, copying, circulation or other use of all or any portion of this message and any attachments is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return e-mail, and delete this message and any attachments from your system. -Original Message- From: Qgis-user On Behalf Of Nicolas Cadieux Sent: Friday, January 21, 2022 12:26 PM To: Qgis Users List Subject: [Qgis-user] Adding alpha band to raster Hi, What is the easiest way, in QGIS3, to add an alpha band to a raster? Alpha bands are handy with the georeferencer. Currently, I am just adding it in GIMP before I start the georeferencer. Thanks -- Nicolas Cadieux https://gitlab.com/njacadieux ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
[Qgis-user] Adding alpha band to raster
Hi, What is the easiest way, in QGIS3, to add an alpha band to a raster? Alpha bands are handy with the georeferencer. Currently, I am just adding it in GIMP before I start the georeferencer. Thanks -- Nicolas Cadieux https://gitlab.com/njacadieux ___ Qgis-user mailing list Qgis-user@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user