<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
mso-fareast-language:EN-CA;}
p.v1msonormal, li.v1msonormal, div.v1msonormal
{mso-style-name:v1msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.v1msolistparagraph, li.v1msolistparagraph, div.v1msolistparagraph
{mso-style-name:v1msolistparagraph;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.v1msonormal0, li.v1msonormal0, div.v1msonormal0
{mso-style-name:v1msonormal0;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.v1msochpdefault, li.v1msochpdefault, div.v1msochpdefault
{mso-style-name:v1msochpdefault;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.v1msohyperlink
{mso-style-name:v1msohyperlink;}
span.v1msohyperlinkfollowed
{mso-style-name:v1msohyperlinkfollowed;}
span.v1htmlpreformattedchar
{mso-style-name:v1htmlpreformattedchar;}
span.v1emailstyle21
{mso-style-name:v1emailstyle21;}
span.v1emailstyle22
{mso-style-name:v1emailstyle22;}
span.v1emailstyle23
{mso-style-name:v1emailstyle23;}
p.v1msonormal1, li.v1msonormal1, div.v1msonormal1
{mso-style-name:v1msonormal1;
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
span.v1msohyperlink1
{mso-style-name:v1msohyperlink1;
mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.v1msohyperlinkfollowed1
{mso-style-name:v1msohyperlinkfollowed1;
mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.v1msolistparagraph1, li.v1msolistparagraph1, div.v1msolistparagraph1
{mso-style-name:v1msolistparagraph1;
mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle36
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle37
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle38
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle40
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Yes, a long time wish indeed! In discussing this with a colleague today I traced back my first strong desrire for such a thing back
to when I got into making elevation models and discovering the hell that results with improperly set nodata. In 1994!
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Now my goal is figure out how to make an external .msk file without going through the heavy processing time of using nearblack. Does
anyone have a utility parameter or python snippet to create a mask file from internal Nodata value cells? or an arbitrary pixel value?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D">-Matt</span><i><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></i></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Nikos Alexandris <nik@nikosalexandris.net>
<br>
<b>Sent:</b> January 13, 2022 4:17 PM<br>
<b>To:</b> Matt.Wilkie <Matt.Wilkie@yukon.ca><br>
<b>Cc:</b> gdal-dev@lists.osgeo.org<br>
<b>Subject:</b> Re: [gdal-dev] Edit geotiff in Gimp and don't lose metadata<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="signature">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">WoW. This is really awesome!<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Whish this existed many years ago... I was using GIMP and all that magic tools but without resampling or altering the size of the image, and carefully re-applying geo-tags
with the use of listgeo and geotifcp (like mentioned in <a href="https://marc.info/?l=grass-user&m=121788119621237">
https://marc.info/?l=grass-user&m=121788119621237</a>) :-).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> <o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> <o:p></o:p></span></p>
</div>
</div>
<p id="reply-intro"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">On 2022-01-13 23:19,
<a href="mailto:Matt.Wilkie@yukon.ca">Matt.Wilkie@yukon.ca</a> wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm">
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> <o:p></o:p></span></p>
</div>
</blockquote>
</blockquote>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm">
<div id="replybody1">
<div>
<p class="v1msonormal1" style="margin-left:36.0pt"><em><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I discovered that starting with v2.10.24 Gimp knows about and keeps geotiff tags intact.[0] This means we can use
tools like Magic Wand fuzzy select and a host of other tools to quickly fix a host of image issues that are difficult to address using command line tools and/or code.
</span></em><o:p></o:p></p>
<p class="v1msonormal1"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="v1msonormal1"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">It gets better: Gimp reads *.msk files without any fuss. This means drastically reduced memory requirements for quickly making simple edits only to the mask layer.
So a person can:</span><o:p></o:p></p>
<p class="v1msonormal1"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">take a large multiband band geotiff with a mask side car file, squash the 3+ bands into 1 band</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">open the original .msk file in Gimp</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">drag and drop the squashed 1 band file on top the Gimp session</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="margin-left:72.0pt;text-indent:-18.0pt"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">o</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">selecting import tif as a Layer</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">Lock the imported layer, set to 50% transparent (or whatever). This is the Visual Guide layer.</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><strong><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Paint as thou wilt on the base mask layer</span></strong><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US"> (Black
is Nodata, White is Data)</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">Delete the visual guide layer</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">Export the base mask layer</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="margin-left:72.0pt;text-indent:-18.0pt"><span style="font-size:11.0pt;font-family:"Courier New";color:#1F497D;mso-fareast-language:EN-US">o</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">Select tiff File Type</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="margin-left:108.0pt;text-indent:-18.0pt"><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:EN-US">§</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">use Deflate compression</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="margin-left:108.0pt;text-indent:-18.0pt"><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:EN-US">§</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">keep metadata (Geotiff will be disabled, that's okay)</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="margin-left:108.0pt;text-indent:-18.0pt"><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:EN-US">§</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">use "input-rgb-geotiff.tif.msk" as file name</span><o:p></o:p></p>
<p class="v1msolistparagraph1" style="text-indent:-18.0pt"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">-</span><span style="font-size:7.0pt;font-family:"Times New Roman",serif;color:#1F497D;mso-fareast-language:EN-US">
</span><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US">DONE!</span><o:p></o:p></p>
<p class="v1msonormal1"><span style="font-size:11.0pt;color:#1F497D;mso-fareast-language:EN-US"> </span><o:p></o:p></p>
<p class="v1msonormal1"><em><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">(this is so awesome. :)</span></em><o:p></o:p></p>
<div>
<p class="v1msonormal1"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="v1msonormal1"><span style="color:#1F497D">-Matt</span><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><o:p></o:p></span></p>
</div>
</blockquote>
</div>
</body>
</html>